[FIX] Correct the fact that moves have not been changed to cancel yet

bzr revid: jco@openerp.com-20140423151600-j9i3jhiyy3nzshvl
This commit is contained in:
Josse Colpaert 2014-04-23 17:16:00 +02:00
parent 7a8222631e
commit 2b3ec22a26
1 changed files with 2 additions and 2 deletions

View File

@ -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':