From 87f2b0e8980181c4d0d6079aacd5cb52a6deb07e Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Thu, 30 May 2013 14:16:02 +0200 Subject: [PATCH] Les topic sont maitenant ceux de semantics --- demo/faq.xml | 8 ++++---- faq.py | 18 ++++++++---------- security/ir.model.access.csv | 4 ++-- views/faq_view.xml | 30 +++++++++++++++--------------- 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/demo/faq.xml b/demo/faq.xml index 2c2cdc3..c633176 100644 --- a/demo/faq.xml +++ b/demo/faq.xml @@ -2,12 +2,12 @@ - + OpenERP Toutes les questions sur OpenERP - + Python L'hymne à Guido Van Rossum ! @@ -15,13 +15,13 @@ Vue Kanban Comment afficher la liste des réponses pour une question ? - + Comment bien programmer ? La phylosophie python - + diff --git a/faq.py b/faq.py index 6642d41..0c82f94 100644 --- a/faq.py +++ b/faq.py @@ -2,24 +2,22 @@ from openerp.osv import osv, fields -class theme(osv.Model): - _name = "faq.theme" +class Topic(osv.Model): + _name = "semantics.topic" - _inherit = "mail.thread" + _inherit = "semantics.topic" def _question_items(self, cr, uid, ids, field, arg, context=None): result={} - for theme in self.browse(cr, uid, ids, context=context): + for topic in self.browse(cr, uid, ids, context=context): res=[] - for question in theme.questions: + for question in topic.questions: res.append({'id': question.id, 'name': question.name, 'answer_items': question.answer_items}) - result[theme.id] = res + result[topic.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"), + "questions": fields.one2many("faq.question" , "topic_id", string="Questions"), "question_items": fields.function(_question_items, type="text", string="Question items"), } @@ -40,7 +38,7 @@ class question(osv.Model): _columns = { "name": fields.char(string="Title", size=64, required=True), "description": fields.text(string="Description"), - "theme_id": fields.many2one("faq.theme", string="Theme", required=True), + "topic_id": fields.many2one("semantics.topic", string="Topic", required=True), "answers": fields.one2many("faq.answer" , "question_id", string="Answers"), "answer_items": fields.function(_answer_items, type="text", string="Answer items"), } diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 50ddf58..d1cbf1e 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,5 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_theme_user,faq.theme,model_faq_theme,group_faq_user,1,0,0,0 -access_theme_manager,faq.theme.manager,model_faq_theme,group_faq_manager,1,1,1,1 +access_topic_user,semantics.topic,model_semantics_topic,group_faq_user,1,0,0,0 +access_topic_manager,semantics.topic.manager,model_semantics_topic,group_faq_manager,1,1,1,1 access_question_user,faq.question,model_faq_question,group_faq_user,1,1,1,1 access_answer_user,faq.answer,model_faq_answer,group_faq_user,1,1,1,1 diff --git a/views/faq_view.xml b/views/faq_view.xml index 782a74f..5377309 100644 --- a/views/faq_view.xml +++ b/views/faq_view.xml @@ -2,13 +2,13 @@ - + - - theme.form - faq.theme + + topic.form + semantics.topic -
+ @@ -22,9 +22,9 @@ - - theme.kanban - faq.theme + + topic.kanban + semantics.topic @@ -46,7 +46,7 @@
-

+

@@ -116,7 +116,7 @@ - + @@ -151,7 +151,7 @@

- (Thème : ) + (Thème : )

@@ -205,12 +205,12 @@ - + Thèmes - faq.theme + semantics.topic kanban,tree,form -

Create your first theme

+

Create your first topic

@@ -237,7 +237,7 @@ - + -- 1.7.10.4