From 69d6d9ba8fa700b588b22578c984065c4e46a146 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 27 Mar 2012 10:34:40 +0200 Subject: [PATCH] [FIX] stock: on inventory, product qty should be computed up to 'inventory date', not after bzr revid: xal@openerp.com-20120327083440-m4sr25bv7wtodmr1 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d26ca8f0da3..657e6c9b5a2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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