From 848721f6d4b3707b0f161d4cee24dd47c24903ad Mon Sep 17 00:00:00 2001 From: "Ravish Murari (OpenERP)" Date: Tue, 17 Jul 2012 11:34:41 +0530 Subject: [PATCH] [FIX] In physical inventory real quantity is not the same as import quantity lp bug: https://launchpad.net/bugs/1023816 fixed bzr revid: rmu@tinyerp.com-20120717060441-ppqje591dd70u7j5 --- addons/stock/wizard/stock_fill_inventory.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index cd6aa59dc66..f5a0a6bc7c0 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -97,16 +97,17 @@ class stock_fill_inventory(osv.osv_memory): for move in move_obj.browse(cr, uid, move_ids, context=context): lot_id = move.prodlot_id.id prod_id = move.product_id.id - if move.location_dest_id.id == location: - qty = uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) - else: - qty = -uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + if move.location_dest_id.id != move.location_id.id: + if move.location_dest_id.id == location: + qty = uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + else: + qty = -uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) - if datas.get((prod_id, lot_id)): - qty += datas[(prod_id, lot_id)]['product_qty'] + if datas.get((prod_id, lot_id)): + qty += datas[(prod_id, lot_id)]['product_qty'] - datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id} + datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id} if datas: flag = True