[FIX] stock: on inventory, product qty should be computed up to 'inventory date', not after

bzr revid: xal@openerp.com-20120327083440-m4sr25bv7wtodmr1
This commit is contained in:
Fabien Pinckaers 2012-03-27 10:34:40 +02:00 committed by Xavier ALT
parent 85be0cf0a4
commit 69d6d9ba8f
1 changed files with 1 additions and 1 deletions

View File

@ -2670,7 +2670,7 @@ class stock_inventory(osv.osv):
move_ids = []
for line in inv.inventory_line_id:
pid = line.product_id.id
product_context.update(uom=line.product_uom.id, date=inv.date, prodlot_id=line.prod_lot_id.id)
product_context.update(uom=line.product_uom.id, to_date=inv.date, date=inv.date, prodlot_id=line.prod_lot_id.id)
amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
change = line.product_qty - amount