[IMP] Add data of subtype in stock

bzr revid: fka@tinyerp.com-20120831050358-fg7r75e0og1myke6
This commit is contained in:
Foram Katharotiya (OpenERP) 2012-08-31 10:33:58 +05:30
parent 91c022497b
commit 82f0465b30
2 changed files with 32 additions and 5 deletions

View 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="close", 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="cancel", context=context)
stock_picking()

View File

@ -164,5 +164,32 @@
<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_close" model="mail.message.subtype">
<field name="name">close</field>
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
</record>
<record id="mail.mail_subtype_cancel" 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'))]"/>
</record>
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
</record>
<record id="mail.mail_subtype_other" model="mail.message.subtype">
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking'))]"/>
</record>
</data>
</openerp>