From: Alicia FLOREZ Date: Wed, 15 May 2013 15:32:41 +0000 (+0200) Subject: Affichage de la liste des questions pour un thème donné en vue Kanban (youpi) X-Git-Url: http://git.inspyration.org/?p=OpenERP%2Ffaq.git;a=commitdiff_plain;h=ee9e11e8989f93b572047aee9f5df10016bda38c Affichage de la liste des questions pour un thème donné en vue Kanban (youpi) --- 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

- +