From 2b3ec22a262808ec604775db26981f9b8fbb61d5 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 23 Apr 2014 17:16:00 +0200 Subject: [PATCH] [FIX] Correct the fact that moves have not been changed to cancel yet bzr revid: jco@openerp.com-20140423151600-j9i3jhiyy3nzshvl --- addons/stock/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9050a4bd173..17a25eb879c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2146,10 +2146,10 @@ class stock_move(osv.osv): self.action_cancel(cr, uid, [move.move_dest_id.id], context=context) # If we have a long chain of moves to be cancelled, it is easier for the user to handle # only the last procurement which will go into exception, instead of all procurements - # along the chain going into exception + # along the chain going into exception. We need to check if there are no split moves not cancelled however if move.procurement_id: proc = move.procurement_id - if all([x.state == 'cancel' for x in proc.move_orig_ids]): + if all([x.state == 'cancel' for x in proc.move_ids if x.id != move.id]): procurement_obj.write(cr, uid, [proc.id], {'state': 'cancel'}) elif move.move_dest_id.state == 'waiting':