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

bzr revid: xal@openerp.com-20120327083935-y6rkl3f51sh1zseq
This commit is contained in:
Xavier ALT
2012-03-27 10:39:35 +02:00
+1 -1
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