From 2a37a94a67d3af78c83562b0f011fe2f903eb53f Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 25 Feb 2015 17:03:17 +0530 Subject: [PATCH] [FIX] purchase: scope of variables is a bitch --- addons/purchase/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index a1f69fd0fe5..4919d3569ad 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1429,8 +1429,8 @@ class procurement_order(osv.osv): po_line_ids = po_line_obj.search(cr, uid, [('order_id', '=', add_purchase), ('product_id', 'in', [x.product_id.id for x in procurements])], context=context) po_lines = po_line_obj.browse(cr, uid, po_line_ids, context=context) po_prod_dict = {} - for po in po_lines: - po_prod_dict[po.product_id.id] = po + for pol in po_lines: + po_prod_dict[po.product_id.id] = pol procs_to_create = [] #Check which procurements need a new line and which need to be added to an existing one for proc in procurements: