From 7027a0130a5d56bb804004ea8e572de930a5ca48 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 9 Sep 2010 20:17:21 +0530 Subject: [PATCH] [IMP]: Fix stock_fill_inventory for set_stock_zero bzr revid: sbh@tinyerp.com-20100909144721-1mcr7erveystgf9d --- addons/stock/wizard/stock_fill_inventory.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index 53a8fabcf2d..d0469960381 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -70,12 +70,11 @@ class stock_fill_inventory(osv.osv_memory): prod = product_obj.browse(cr, uid, [product_id])[0] uom = prod.uom_id.id context.update(uom=uom, compute_child=False) - if fill_inventory.set_stock_zero: - amount = 0 - else: - amount = stock_location_obj._product_get(cr, uid, + amount = stock_location_obj._product_get(cr, uid, location, [product_id], context=context)[product_id] if(amount): + if fill_inventory.set_stock_zero: + amount = 0 line_ids=inventory_line_obj.search(cr, uid, [('inventory_id', '=', context['active_ids']), ('location_id', '=', location),