From 591d207ff94afeddbe77992a55b86927e53903dc Mon Sep 17 00:00:00 2001 From: jesusVMayor Date: Fri, 6 Mar 2015 11:54:09 +0100 Subject: [PATCH] [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. --- addons/sale/sale.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c64a55920f5..ff968e1ab67 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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