Randhir Mayatra (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_account-rma 
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-demo_account-rma/+merge/122062

Hello Sir,

I have add the data into account module for subtype.

Thank you.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_account-rma/+merge/122062
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-08-30 11:24:26 +0000
+++ account/account_invoice.py	2012-08-30 13:09:43 +0000
@@ -1298,16 +1298,15 @@
 
     def create_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, [obj.id], body=_("%s <b>created</b>.") % (_(self._get_document_type(obj.type))), context=context)
+            self.message_post(cr, uid, [obj.id],body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)), subtype="new", context=context)
 
     def confirm_paid_send_note(self, cr, uid, ids, context=None):
-        for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (_(self._get_document_type(obj.type))), context=context)
+         for obj in self.browse(cr, uid, ids, context=context):
+            self.message_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (self._get_document_type(obj.type)), subtype="paid", context=context)
 
     def invoice_cancel_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (_(self._get_document_type(obj.type))), context=context)
-
+            self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancel", context=context)
 account_invoice()
 
 class account_invoice_line(osv.osv):

=== modified file 'account/data/account_data.xml'
--- account/data/account_data.xml	2012-06-07 12:36:41 +0000
+++ account/data/account_data.xml	2012-08-30 13:09:43 +0000
@@ -563,8 +563,28 @@
             <field name="name">Invoice</field>
             <field name="object">account.invoice</field>
         </record>
-
-
-
+		<record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('analytic.model_account_analytic_account')),(4,ref('account.model_account_invoice'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_paid" model="mail.message.subtype">
+            <field name="name">paid</field>
+            <field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancel" model="mail.message.subtype">
+            <field name="name">cancel</field>
+            <field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+		<record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
+        </record>
     </data>
 </openerp>

=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2012-08-21 15:09:36 +0000
+++ account_voucher/account_voucher.py	2012-08-30 13:09:43 +0000
@@ -1293,17 +1293,17 @@
     def create_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
             message = "%s <b>created</b>." % self._document_type[obj.type or False]
-            self.message_post(cr, uid, [obj.id], body=message, context=context)
+            self.message_post(cr, uid, [obj.id], body=message, subtype="new", context=context)
 
     def post_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
             message = "%s '%s' is <b>posted</b>." % (self._document_type[obj.type or False], obj.move_id.name)
-            self.message_post(cr, uid, [obj.id], body=message, context=context)
+            self.message_post(cr, uid, [obj.id], body=message, subtype="post", context=context)
 
     def reconcile_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
             message = "%s <b>reconciled</b>." % self._document_type[obj.type or False]
-            self.message_post(cr, uid, [obj.id], body=message, context=context)
+            self.message_post(cr, uid, [obj.id], body=message, subtype="reconcile", context=context)
 
 account_voucher()
 

=== modified file 'account_voucher/account_voucher_data.xml'
--- account_voucher/account_voucher_data.xml	2012-08-17 11:19:36 +0000
+++ account_voucher/account_voucher_data.xml	2012-08-30 13:09:43 +0000
@@ -12,5 +12,28 @@
 If you want to use advanced accounting features, you should install the "Accounting and Finance" module.</value>
             <value>Module eInvoicing &amp; Payments has been installed.</value>
         </function>
+        <!-- Message Sub Type -->
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+        	<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+        </record>
+        <record id="mail.mail_subtype_post" model="mail.message.subtype">
+            <field name="name">post</field>
+            <field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_reconcile" model="mail.message.subtype">
+            <field name="name">reconcile</field>
+            <field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
+        </record>
     </data>
 </openerp>

=== modified file 'analytic/analytic.py'
--- analytic/analytic.py	2012-08-30 11:24:26 +0000
+++ analytic/analytic.py	2012-08-30 13:09:43 +0000
@@ -297,7 +297,7 @@
 
     def create_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), context=context)
+            self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), subtype="new", context=context)
 
 account_analytic_account()
 

_______________________________________________
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