[IMP] add received & delivered subtype in stock
authorForam Katharotiya (OpenERP) <fka@tinyerp.com>
Mon, 3 Sep 2012 12:34:05 +0000 (18:04 +0530)
committerForam Katharotiya (OpenERP) <fka@tinyerp.com>
Mon, 3 Sep 2012 12:34:05 +0000 (18:04 +0530)
bzr revid: fka@tinyerp.com-20120903123405-7rmte2src1xtdghp

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

index 0bc455a..ed20bbe 100644 (file)
@@ -1394,7 +1394,7 @@ 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')), subtype="closed", context=context)
+            self.message_post(cr, uid, [obj.id], body=_("Products have been <b>%s</b>.") % (type_dict.get(obj.type, 'move done')), subtype=type_dict.get(obj.type), context=context)
 
     def ship_cancel_send_note(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
index 3539d5b..f83b0ad 100644 (file)
@@ -171,27 +171,29 @@ watch your stock valuation, and track production lots upstream and downstream (b
     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')),(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
         </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')),(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+        <record id="mail.mail_subtype_delivered" model="mail.message.subtype">
+            <field name="name">delivered</field>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_out'))]"/>
+            <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('stock.model_stock_picking')),(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+        <record id="mail.mail_subtype_received" model="mail.message.subtype">
+            <field name="name">received</field>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in'))]"/>
+            <field name="default" eval="False"/>
         </record>
         <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
-            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking')),(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
         </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_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
         </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_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
         </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_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
+            <field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
         </record>
     </data>
 </openerp>