From fff3739cc2b111e226e8d13e85c969e8ab83827e Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Tue, 18 Jun 2013 21:41:08 +0200 Subject: [PATCH] [fix] propagation of the context is missing --- stock_lot_valuation/stock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stock_lot_valuation/stock.py b/stock_lot_valuation/stock.py index 40eb215f5..c0745b51f 100644 --- a/stock_lot_valuation/stock.py +++ b/stock_lot_valuation/stock.py @@ -226,7 +226,7 @@ class stock_picking(orm.Model): product_currency = partial_data.get('product_currency',False) product_price = partial_data.get('product_price',0.0) - lot = lot_obj.browse(cr, uid, move.prodlot_id.id) + lot = lot_obj.browse(cr, uid, move.prodlot_id.id, context=context) product = lot.product_id move_currency_id = move.company_id.currency_id.id context['currency_id'] = move_currency_id @@ -245,14 +245,15 @@ class stock_picking(orm.Model): new_std_price = (((amount_unit * lot.stock_available) + (new_price * qty))/(lot.stock_available + qty)) - lot_obj.write(cr, uid, [lot.id],{'standard_price': new_std_price}) + lot_obj.write(cr, uid, [lot.id],{'standard_price': new_std_price}, + context=context) # Record the values that were chosen in the wizard, so they can be # used for inventory valuation if real-time valuation is enabled. move_obj.write(cr, uid, [move.id],{ 'price_unit': product_price, 'price_currency_id': product_currency - }) + }, context=context) def write_lot(self, cr, uid, move, partial_datas, context=None): lot_obj = self.pool.get('stock.production.lot')