[MERGE] Merge with parent branch
authorForam Katharotiya (OpenERP) <fka@tinyerp.com>
Mon, 3 Sep 2012 07:04:34 +0000 (12:34 +0530)
committerForam Katharotiya (OpenERP) <fka@tinyerp.com>
Mon, 3 Sep 2012 07:04:34 +0000 (12:34 +0530)
bzr revid: fka@tinyerp.com-20120903051925-r01yx7u7nvono353
bzr revid: fka@tinyerp.com-20120903070434-on2thgronzgnk5am

addons/stock/stock.py
addons/stock/stock_data.xml

index 006af58..0bc455a 100644 (file)
@@ -1379,13 +1379,13 @@ class stock_picking(osv.osv):
 
     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 has been <b>created</b>.") % (self._get_document_type(obj.type)), context=context)
+            self.message_post(cr, uid, [obj.id], body=_("%s has been <b>created</b>.") % (self._get_document_type(obj.type)), subtype="new", context=context)
 
     def scrap_send_note(self, cr, uid, ids, quantity, uom, name, context=None):
-        return self.message_post(cr, uid, ids, body= _("%s %s %s has been <b>moved to</b> scrap.") % (quantity, uom, name), context=context)
+        return self.message_post(cr, uid, ids, body= _("%s %s %s has been <b>moved to</b> scrap.") % (quantity, uom, name), subtype="moved", context=context)
 
     def back_order_send_note(self, cr, uid, ids, back_name, context=None):
-        return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_name), context=context)
+        return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_name), subtype="new", context=context)
 
     def ship_done_send_note(self, cr, uid, ids, context=None):
         type_dict = {
@@ -1394,11 +1394,11 @@ class stock_picking(osv.osv):
                 'internal': 'moved',
         }
         for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, [obj.id], body=_("Products have been <b>%s</b>.") % (type_dict.get(obj.type, 'move done')), context=context)
+            self.message_post(cr, uid, [obj.id], body=_("Products have been <b>%s</b>.") % (type_dict.get(obj.type, 'move done')), subtype="closed", context=context)
 
     def ship_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 has been <b>cancelled</b>.") % (self._get_document_type(obj.type)), context=context)
+            self.message_post(cr, uid, [obj.id], body=_("%s has been <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancelled", context=context)
 
 
 stock_picking()
index 77c8298..a7e2ffd 100644 (file)
@@ -166,5 +166,32 @@ watch your stock valuation, and track production lots upstream and downstream (b
             <field name="lot_stock_id" ref="stock_location_stock"/>
             <field name="lot_output_id" ref="stock_location_output"/>
         </record>
+
+        <!--
+    Mail: mail.message.subtype
+    -->
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
+        </record>
+        <record id="mail.mail_subtype_moved" model="mail.message.subtype">
+            <field name="name">moved</field>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
+        </record>
+        <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking')), (4,ref('stock.model_stock_move'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking')), (4,ref('stock.model_stock_move'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking')), (4,ref('stock.model_stock_move'))]"/>
+        </record>
     </data>
 </openerp>