From ee9e11e8989f93b572047aee9f5df10016bda38c Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Wed, 15 May 2013 17:32:41 +0200 Subject: [PATCH] =?utf8?q?Affichage=20de=20la=20liste=20des=20questions=20po?= =?utf8?q?ur=20un=20th=C3=A8me=20donn=C3=A9=20en=20vue=20Kanban=20(youpi)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- faq.py | 10 ++++++++++ views/faq_view.xml | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/faq.py b/faq.py index ed1ad8c..4b52d0a 100644 --- a/faq.py +++ b/faq.py @@ -5,10 +5,20 @@ from openerp.osv import osv, fields class theme(osv.Model): _name = "faq.theme" + def _question_items(self, cr, uid, ids, field, arg, context=None): + result={} + for theme in self.browse(cr, uid, ids, context=context): + res=[] + for question in theme.questions: + res.append({'id': question.id, 'name': question.name}) + result[theme.id] = res + return result + _columns = { "name": fields.char(string="Title", size=64, required=True), "description": fields.text(string="Description"), "questions": fields.one2many("faq.question" , "theme_id", string="Questions"), + "question_items": fields.function(_question_items, type="text", string="Question items"), } class question(osv.Model): diff --git a/views/faq_view.xml b/views/faq_view.xml index e71d8d3..c9c6339 100644 --- a/views/faq_view.xml +++ b/views/faq_view.xml @@ -45,11 +45,24 @@

Questions

+ +
    +
  • + + + + +
  • +
- +

Pas de question pour ce thèmes.

+
+ +

(ID : )

+
@@ -94,10 +107,9 @@

Question

-

Réponses

- +
  • -- 1.7.10.4