[IMP]: Fix stock_fill_inventory for set_stock_zero

bzr revid: sbh@tinyerp.com-20100909144721-1mcr7erveystgf9d
This commit is contained in:
sbh (Open ERP) 2010-09-09 20:17:21 +05:30
parent 8b6e629f6d
commit 7027a0130a
1 changed files with 3 additions and 4 deletions

View File

@ -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),