diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index d577e69e237..50e85fa5191 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -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 created.") % (self._get_document_type(obj.type)), subtype="new", context=context)
+ self.message_post(cr, uid, [obj.id], body=_("%s has been created.") % (self._get_document_type(obj.type)), subtype_xml_id="stock_in_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 moved to scrap.") % (quantity, uom, name), subtype="moved", context=context)
+ return self.message_post(cr, uid, ids, body= _("%s %s %s has been moved to scrap.") % (quantity, uom, name),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 %s has been created.") % (back_name), subtype="new", context=context)
+ return self.message_post(cr, uid, ids, body=_("Back order %s has been created.") % (back_name), subtype_xml_id="stock_in_subtype_new", context=context)
def ship_done_send_note(self, cr, uid, ids, context=None):
type_dict = {
@@ -1393,12 +1393,20 @@ class stock_picking(osv.osv):
'in': 'received',
'internal': 'moved',
}
+ xml_id_dict = {
+ 'out':'stock_out_subtype_delivered',
+ 'in' : 'stock_in_subtype_received'
+ }
for obj in self.browse(cr, uid, ids, context=context):
- self.message_post(cr, uid, [obj.id], body=_("Products have been %s.") % (type_dict.get(obj.type, 'move done')), subtype=type_dict.get(obj.type), context=context)
+ self.message_post(cr, uid, [obj.id], body=_("Products have been %s.") % (type_dict.get(obj.type, 'move done')), subtype_xml_id=xml_id_dict.get(obj.type), context=context)
def ship_cancel_send_note(self, cr, uid, ids, context=None):
+ xml_id_dict = {
+ 'out':'stock_out_subtype_cancelled',
+ 'in' : 'stock_in_subtype_cancelled'
+ }
for obj in self.browse(cr, uid, ids, context=context):
- self.message_post(cr, uid, [obj.id], body=_("%s has been cancelled.") % (self._get_document_type(obj.type)), subtype="cancelled", context=context)
+ self.message_post(cr, uid, [obj.id], body=_("%s has been cancelled.") % (self._get_document_type(obj.type)), subtype_xml_id=xml_id_dict.get(obj.type), context=context)
stock_picking()
diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml
index f83b0ada388..a59642fa912 100644
--- a/addons/stock/stock_data.xml
+++ b/addons/stock/stock_data.xml
@@ -170,30 +170,27 @@ watch your stock valuation, and track production lots upstream and downstream (b
-
-
+
+ new
+ stock.picking.in
-
+
delivered
-
+ stock.picking.out
-
+
received
-
+ stock.picking.in
-
-
+
+ cancelled
+ stock.picking.in
-
-
-
-
-
-
+
+ cancelled
+ stock.picking.out