Foram Katharotiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-idea_data-fka into 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.

Requested reviews:
  Amit Patel (OpenERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-idea_data-fka/+merge/122196

Hello Sir,

  Add data of subtype in idea module

Thanks,
FKA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-idea_data-fka/+merge/122196
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'idea/idea.py'
--- idea/idea.py	2012-08-17 10:03:02 +0000
+++ idea/idea.py	2012-08-31 06:38:25 +0000
@@ -67,21 +67,21 @@
 
     def idea_cancel(self, cr, uid, ids, context={}):
         self.write(cr, uid, ids, { 'state': 'cancel' })
-        self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context)
+        self.message_post(cr, uid, ids, body=_('Idea canceled.'), subtype="cancel", context=context)
         return True
 
     def idea_open(self, cr, uid, ids, context={}):
         self.write(cr, uid, ids, { 'state': 'open'})
-        self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context)
+        self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context)
         return True
 
     def idea_close(self, cr, uid, ids, context={}):
-        self.message_post(cr, uid, ids, body=_('Idea done.'), context=context)
+        self.message_post(cr, uid, ids, body=_('Idea done.'), subtype="close", context=context)
         self.write(cr, uid, ids, { 'state': 'close' })
         return True
 
     def idea_draft(self, cr, uid, ids, context={}):
-        self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context)
+        self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context)
         self.write(cr, uid, ids, { 'state': 'draft' })
         return True
 idea_idea()

=== modified file 'idea/idea_data.xml'
--- idea/idea_data.xml	2012-06-07 17:51:58 +0000
+++ idea/idea_data.xml	2012-08-31 06:38:25 +0000
@@ -15,6 +15,35 @@
         <record id="base.user_demo" model="res.users">
             <field name="groups_id" eval="[(4,ref('base.group_tool_user'))]"/>
         </record>
+
+        <!-- SUBTYPE -->
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_open" model="mail.message.subtype">
+            <field name="name">open</field>
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancel" model="mail.message.subtype">
+            <field name="name">cancel</field>
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_close" model="mail.message.subtype">
+            <field name="name">close</field>
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
+        </record>
     </data>
 </openerp>
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to