Foram Katharotiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-mrp_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-mrp_data-fka/+merge/122273

Hello Sir,

  Add data of subtype in MRP, MRP_Repair & MRP_Operations Module.

Thanks,
FKA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-mrp_data-fka/+merge/122273
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2012-08-22 15:31:45 +0000
+++ mrp/mrp.py	2012-08-31 13:21:20 +0000
@@ -1047,27 +1047,27 @@
     # ---------------------------------------------------
 
     def create_send_note(self, cr, uid, ids, context=None):
-        self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), context=context)
+        self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype="new", context=context)
         return True
 
     def action_cancel_send_note(self, cr, uid, ids, context=None):
         message = _("Manufacturing order has been <b>canceled</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
         return True
 
     def action_ready_send_note(self, cr, uid, ids, context=None):
         message = _("Manufacturing order is <b>ready to produce</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
         return True
 
     def action_in_production_send_note(self, cr, uid, ids, context=None):
         message = _("Manufacturing order is <b>in production</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="production", context=context)
         return True
 
     def action_done_send_note(self, cr, uid, ids, context=None):
         message = _("Manufacturing order has been <b>done</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
         return True
 
     def action_confirm_send_note(self, cr, uid, ids, context=None):

=== modified file 'mrp/mrp_data.xml'
--- mrp/mrp_data.xml	2012-08-30 14:18:52 +0000
+++ mrp/mrp_data.xml	2012-08-31 13:21:20 +0000
@@ -27,5 +27,38 @@
             <field name="number_increment">1</field>
         </record>
         
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_ready" model="mail.message.subtype">
+            <field name="name">ready</field>
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_production" model="mail.message.subtype">
+            <field name="name">production</field>
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+            <field name="name">cancelled</field>
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
+        </record>
     </data>
 </openerp>

=== modified file 'mrp_operations/mrp_operation_data.xml'
--- mrp_operations/mrp_operation_data.xml	2012-06-28 06:40:05 +0000
+++ mrp_operations/mrp_operation_data.xml	2012-08-31 13:21:20 +0000
@@ -30,5 +30,39 @@
         <field name="start_stop">done</field>
     </record>
 
+    <!-- SUBTYPE -->
+    <record id="mail.mail_subtype_new" model="mail.message.subtype">
+        <field name="name">new</field>
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_started" model="mail.message.subtype">
+        <field name="name">started</field>
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_pending" model="mail.message.subtype">
+        <field name="name">pending</field>
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+    </record>
+    <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+        <field name="name">cancelled</field>
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+        <field name="name">closed</field>
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_email" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+    </record>
+    <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+    </record>
+    <record id="mail.mail_subtype_other" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
+    </record>
 </data>
 </openerp>

=== modified file 'mrp_operations/mrp_operations.py'
--- mrp_operations/mrp_operations.py	2012-08-17 10:03:02 +0000
+++ mrp_operations/mrp_operations.py	2012-08-31 13:21:20 +0000
@@ -224,7 +224,7 @@
         for workorder in self.browse(cr, uid, ids):
             for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
                 message = _("Work order has been <b>created</b> for production order <em>%s</em>.") % (prod.id.name)
-                self.message_post(cr, uid, [workorder.id], body=message, context=context)
+                self.message_post(cr, uid, [workorder.id], body=message, subtype="new", context=context)
         return True
 
     def action_start_send_note(self, cr, uid, ids, context=None):
@@ -232,7 +232,7 @@
         for workorder in self.browse(cr, uid, ids):
             for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
                 message = _("Work order has been <b>started</b> for production order <em>%s</em>.") % (prod.id.name)
-                self.message_post(cr, uid, [workorder.id], body=message, context=context)
+                self.message_post(cr, uid, [workorder.id], body=message, subtype="started", context=context)
         return True
 
     def action_done_send_note(self, cr, uid, ids, context=None):
@@ -240,7 +240,7 @@
         for workorder in self.browse(cr, uid, ids):
             for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
                 message = _("Work order has been <b>done</b> for production order <em>%s</em>.") % (prod.id.name)
-                self.message_post(cr, uid, [workorder.id], body=message, context=context)
+                self.message_post(cr, uid, [workorder.id], body=message, subtype="closed", context=context)
         return True
 
     def action_pending_send_note(self, cr, uid, ids, context=None):
@@ -248,7 +248,7 @@
         for workorder in self.browse(cr, uid, ids):
             for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
                 message = _("Work order is <b>pending</b> for production order <em>%s</em>.") % (prod.id.name)
-                self.message_post(cr, uid, [workorder.id], body=message, context=context)
+                self.message_post(cr, uid, [workorder.id], body=message, subtype="pending", context=context)
         return True
 
     def action_cancel_send_note(self, cr, uid, ids, context=None):
@@ -256,7 +256,7 @@
         for workorder in self.browse(cr, uid, ids):
             for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
                 message = _("Work order has been <b>cancelled</b> for production order <em>%s</em>.") % (prod.id.name)
-                self.message_post(cr, uid, [workorder.id], body=message, context=context)
+                self.message_post(cr, uid, [workorder.id], body=message, subtype="cancelled", context=context)
         return True
 
 mrp_production_workcenter_line()

=== modified file 'mrp_repair/__openerp__.py'
--- mrp_repair/__openerp__.py	2012-08-22 13:02:32 +0000
+++ mrp_repair/__openerp__.py	2012-08-31 13:21:20 +0000
@@ -43,6 +43,7 @@
     'data': [
         'security/ir.model.access.csv',
         'security/mrp_repair_security.xml',
+        'mrp_repair_data.xml',
         'mrp_repair_sequence.xml',
         'wizard/mrp_repair_cancel_view.xml',
         'wizard/mrp_repair_make_invoice_view.xml',

=== modified file 'mrp_repair/mrp_repair.py'
--- mrp_repair/mrp_repair.py	2012-08-31 09:03:08 +0000
+++ mrp_repair/mrp_repair.py	2012-08-31 13:21:20 +0000
@@ -571,40 +571,40 @@
     def create_send_note(self, cr, uid, ids, context=None):
         for repair in self.browse(cr, uid, ids, context):
             message = _("Repair Order for <em>%s</em> has been <b>created</b>." % (repair.product_id.name))
-            self.message_post(cr, uid, [repair.id], body=message, context=context)
+            self.message_post(cr, uid, [repair.id], body=message, subtype="new", context=context)
         return True
 
     def set_start_send_note(self, cr, uid, ids, context=None):
         for repair in self.browse(cr, uid, ids, context):
             message = _("Repair Order for <em>%s</em> has been <b>started</b>." % (repair.product_id.name))
-            self.message_post(cr, uid, [repair.id], body=message, context=context)
+            self.message_post(cr, uid, [repair.id], body=message, subtype="started", context=context)
         return True
 
     def set_toinvoiced_send_note(self, cr, uid, ids, context=None):
         for repair in self.browse(cr, uid, ids, context):
             message = _("Draft Invoice of %s %s <b>waiting for validation</b>.") % (repair.invoice_id.amount_total, repair.invoice_id.currency_id.symbol)
-            self.message_post(cr, uid, [repair.id], body=message, context=context)
+            self.message_post(cr, uid, [repair.id], body=message, subtype="pending", context=context)
         return True
 
     def set_confirm_send_note(self, cr, uid, ids, context=None):
         for repair in self.browse(cr, uid, ids, context):
             message = _( "Repair Order for <em>%s</em> has been <b>accepted</b>." % (repair.product_id.name))
-            self.message_post(cr, uid, [repair.id], body=message, context=context)
+            self.message_post(cr, uid, [repair.id], body=message, subtype="accepted", context=context)
         return True
 
     def set_cancel_send_note(self, cr, uid, ids, context=None):
         message = _("Repair has been <b>cancelled</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
         return True
 
     def set_ready_send_note(self, cr, uid, ids, context=None):
         message = _("Repair Order is now <b>ready</b> to repair.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
         return True
 
     def set_done_send_note(self, cr, uid, ids, context=None):
         message = _("Repair Order is <b>closed</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
         return True
 
 mrp_repair()

=== added file 'mrp_repair/mrp_repair_data.xml'
--- mrp_repair/mrp_repair_data.xml	1970-01-01 00:00:00 +0000
+++ mrp_repair/mrp_repair_data.xml	2012-08-31 13:21:20 +0000
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<openerp>
+<data noupdate="1">
+
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_started" model="mail.message.subtype">
+            <field name="name">started</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_ready" model="mail.message.subtype">
+            <field name="name">ready</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_pending" model="mail.message.subtype">
+            <field name="name">pending</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+        </record>
+        <record id="mail.mail_subtype_accepted" model="mail.message.subtype">
+            <field name="name">accepted</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+            <field name="name">cancelled</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
+        </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