From 799590426f5edec59717562539150c3e2b2ab305 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Tue, 11 Jun 2013 14:43:38 +0200 Subject: [PATCH] [FIX] propagate context through stock.move.action_cancel() bzr revid: ls@numerigraphe.fr-20130611124338-644rre13nhmnesvv --- addons/stock/stock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b632101208f..92b378fe315 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1962,15 +1962,15 @@ class stock_move(osv.osv): if move.picking_id: pickings[move.picking_id.id] = True if move.move_dest_id and move.move_dest_id.state == 'waiting': - self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) + self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}, context=context) if context.get('call_unlink',False) and move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) - self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}) + self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}, context=context) if not context.get('call_unlink',False): for pick in self.pool.get('stock.picking').browse(cr, uid, pickings.keys()): if all(move.state == 'cancel' for move in pick.move_lines): - self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}) + self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}, context=context) wf_service = netsvc.LocalService("workflow") for id in ids: