[FIX] sale: reset state of exception procurements only

During the delivery of a picking the procurents in exception or canceled are
reset to confirm state.
As the list of picking was a list shared in the loop, other procurements may be
reset to confirm as well.
This commit is contained in:
jesusVMayor 2015-03-06 11:54:09 +01:00 committed by Martin Trigaux
parent c040a26120
commit 591d207ff9
1 changed files with 3 additions and 2 deletions

View File

@ -713,8 +713,9 @@ class sale_order(osv.osv):
procurement_obj.check(cr, uid, [x.id for x in line.procurement_ids if x.state not in ['cancel', 'done']])
line.refresh()
#run again procurement that are in exception in order to trigger another move
proc_ids += [x.id for x in line.procurement_ids if x.state in ('exception', 'cancel')]
procurement_obj.reset_to_confirmed(cr, uid, proc_ids, context=context)
except_proc_ids = [x.id for x in line.procurement_ids if x.state in ('exception', 'cancel')]
procurement_obj.reset_to_confirmed(cr, uid, except_proc_ids, context=context)
proc_ids += except_proc_ids
elif sale_line_obj.need_procurement(cr, uid, [line.id], context=context):
if (line.state == 'done') or not line.product_id:
continue