[IMP] Improve code for products delivered.

bzr revid: bth@tinyerp.com-20130213112125-1cbzelqg659pwc56
This commit is contained in:
Bhumi Thakkar (Open ERP)
2013-02-13 16:51:25 +05:30
parent 9f182085e9
commit 00c07052ca
2 changed files with 5 additions and 11 deletions
-10
View File
@@ -1004,14 +1004,4 @@ class account_invoice(osv.Model):
self.pool.get('sale.order').message_post(cr, uid, so_ids, body=_("Invoice <b>Paid</b>"), context=context)
return res
class stock_picking(osv.Model):
_inherit = 'stock.picking'
def action_done(self, cr, uid, ids, context=None):
res = super(stock_picking, self).action_done(cr, uid, ids, context=None)
for stockpicking in self.browse(cr, uid, ids, context):
if stockpicking.type == "out":
for sale in self.pool.get('sale.order').browse(cr, uid, [stockpicking.sale_id.id], context):
sale.message_post(body=_("%s <b>Delivered</b>") % (sale._description))
return True
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+5 -1
View File
@@ -874,8 +874,12 @@ class stock_picking(osv.osv):
This method is called at the end of the workflow by the activity "done".
@return: True
"""
"""
self.write(cr, uid, ids, {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')})
for record in self.browse(cr, uid, ids, context):
if record.type == "out":
for sale in self.pool.get('sale.order').browse(cr, uid, [record.sale_id.id], context):
sale.message_post(body=_("Products <b>Delivered</b>"))
return True
def action_move(self, cr, uid, ids, context=None):