[IMP] Improve code for products delivered.
bzr revid: bth@tinyerp.com-20130213112125-1cbzelqg659pwc56
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user