Rajout d'un chatter pour les 3 objets V1.0
authorAlicia FLOREZ <alicflorez@gmail.com>
Fri, 24 May 2013 09:41:25 +0000 (11:41 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Fri, 24 May 2013 09:41:25 +0000 (11:41 +0200)
__openerp__.py
faq.py
views/faq_view.xml

index c3593eb..4323d03 100644 (file)
@@ -1,7 +1,7 @@
 {
     "name": "FAQ",
     "version": "1.0",
-    "depends": ["base"],
+    "depends": ["base", 'mail'],
     "author": "Moi",
     "category": "Category",
     "description": """Frequently Asked Questions""",
diff --git a/faq.py b/faq.py
index 87f9d85..6642d41 100644 (file)
--- a/faq.py
+++ b/faq.py
@@ -5,6 +5,8 @@ from openerp.osv import osv, fields
 class theme(osv.Model):
     _name = "faq.theme"
 
+    _inherit = "mail.thread"
+
     def _question_items(self, cr, uid, ids, field, arg, context=None):
         result={}
         for theme in self.browse(cr, uid, ids, context=context):
@@ -24,6 +26,8 @@ class theme(osv.Model):
 class question(osv.Model):
     _name = "faq.question"
 
+    _inherit = "mail.thread"
+
     def _answer_items(self, cr, uid, ids, field, arg, context=None):
         result={}
         for question in self.browse(cr, uid, ids, context=context):
@@ -44,6 +48,8 @@ class question(osv.Model):
 class answer(osv.Model):
     _name = "faq.answer"
 
+    _inherit = "mail.thread"
+
     _columns = {
         "name": fields.char(string="Title", size=64, required=True),
         "description": fields.text(string="Description"),
index 580d170..47a9259 100644 (file)
@@ -9,9 +9,15 @@
             <field name="model">faq.theme</field>
             <field name="arch" type="xml">
                 <form string="Theme Form" version="7.0">
-                    <field name="name" />
-                    <field name="description"/>
-                    <field name="questions" />
+                    <sheet>
+                        <field name="name" />
+                        <field name="description"/>
+                        <field name="questions" />
+                    </sheet>
+                    <div class="oe_chatter">
+                        <field name="message_follower_ids" widget="mail_followers"/>
+                        <field name="message_ids" widget="mail_thread" options="{'thread_level': 1}"/>
+                    </div>
                 </form>
             </field>
         </record>
             <field name="model">faq.question</field>
             <field name="arch" type="xml">
                 <form string="Question Form" version="7.0">
-                    <field name="name" />
-                    <field name="theme_id" />
-                    <field name="description" />
-                    <field name="answers" />
+                    <sheet>
+                        <field name="name" />
+                        <field name="theme_id" />
+                        <field name="description" />
+                        <field name="answers" />
+                    </sheet>
+                    <div class="oe_chatter">
+                        <field name="message_follower_ids" widget="mail_followers"/>
+                        <field name="message_ids" widget="mail_thread" options="{'thread_level': 1}"/>
+                    </div>
                 </form>
             </field>
         </record>
             <field name="model">faq.answer</field>
             <field name="arch" type="xml">
                 <form string="Answer Form" version="7.0">
-                    <field name="name" />
-                    <field name="description" />
+                    <sheet>
+                        <field name="name" />
+                        <field name="description" />
+                    </sheet>
+                    <div class="oe_chatter">
+                        <field name="message_follower_ids" widget="mail_followers"/>
+                        <field name="message_ids" widget="mail_thread" options="{'thread_level': 1}"/>
+                    </div>
                 </form>
             </field>
         </record>
 
 
+
+        <!-- ACTIONS & MENUS -->
+
         <record model="ir.actions.act_window" id="faq_themes_action">
             <field name="name">Thèmes</field>
             <field name="res_model">faq.theme</field>