[FIX] inventory computation
bzr revid: fp@tinyerp.com-20120929105104-x89om7ks4vbeqqqe
This commit is contained in:
commit
6c4252a770
|
@ -109,16 +109,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
|
||||
|
|
Loading…
Reference in New Issue