From b3c6afee5c7f028c478e957ef374be19e6d58f59 Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Sat, 11 May 2013 10:12:01 +0200 Subject: [PATCH] [fix] lot qty --- stock_lot_valuation/stock.py | 2 +- stock_lot_valuation/test/opening_stock.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stock_lot_valuation/stock.py b/stock_lot_valuation/stock.py index b947c7266..d1a4ae775 100644 --- a/stock_lot_valuation/stock.py +++ b/stock_lot_valuation/stock.py @@ -84,7 +84,7 @@ class stock_production_lot(orm.Model): for location in location_obj.browse(cr, uid, loc_ids, context=context): c = context.copy() c.update({ - 'location': location.id, + 'location_id': location.id, 'compute_child': False }) diff --git a/stock_lot_valuation/test/opening_stock.yml b/stock_lot_valuation/test/opening_stock.yml index ac8eacf47..6110d7e20 100644 --- a/stock_lot_valuation/test/opening_stock.yml +++ b/stock_lot_valuation/test/opening_stock.yml @@ -172,3 +172,5 @@ !python {model: stock.production.lot}: | lot = self.browse(cr, uid, ref('lot_icecream_0'), context=context) assert lot.standard_price == 120, "Price is not updated." + balance = self.pool.get('account.account').browse(cr, uid, ref('account.stk')).balance + assert balance == 6000.0, "Purchased Stocks balance is %s, not 6000 (old balance + (lot.standard_price - new_price) * lot.stock_available)" % balance