[IMP]changed in sale module for subtype update specification
bzr revid: sgo@tinyerp.com-20120913085727-7swp0404g99fkf7l
This commit is contained in:
+13
-5
@@ -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)), subtype="new", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s has been <b>created</b>.") % (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 <b>moved to</b> scrap.") % (quantity, uom, name), subtype="moved", context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("%s %s %s has been <b>moved to</b> 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 <em>%s</em> has been <b>created</b>.") % (back_name), subtype="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (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 <b>%s</b>.") % (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 <b>%s</b>.") % (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 <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s has been <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype_xml_id=xml_id_dict.get(obj.type), context=context)
|
||||
|
||||
|
||||
stock_picking()
|
||||
|
||||
+13
-16
@@ -170,30 +170,27 @@ 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_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_in_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">stock.picking.in</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_delivered" model="mail.message.subtype">
|
||||
<record id="mail.stock_out_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="res_model">stock.picking.out</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_received" model="mail.message.subtype">
|
||||
<record id="mail.stock_in_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="res_model">stock.picking.in</field>
|
||||
<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_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_in_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">stock.picking.in</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<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_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_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_out_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">stock.picking.out</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user