From ce002df9ba5db67029bda0f10036117adcea359d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 5 Mar 2013 10:36:56 +0100 Subject: [PATCH] Fix missing unit_price currency convertion issue3036 review697002 (transplanted from 1d1da0ad31d92ddc55db2710ef7ee850caee60b5) --- stock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stock.py b/stock.py index 161b2389f2..4bd1729161 100644 --- a/stock.py +++ b/stock.py @@ -22,6 +22,7 @@ class Move: pool = Pool() Uom = pool.get('product.uom') AccountMoveLine = pool.get('account.move.line') + Currency = pool.get('currency.currency') assert type_.startswith('in_') or type_.startswith('out_'), \ 'wrong type' @@ -30,7 +31,9 @@ class Move: if ((type_.endswith('supplier') or type_ == 'in_production') and self.product.cost_price_method != 'fixed'): - unit_price = self.unit_price + with Transaction().set_context(date=self.effective_date): + unit_price = Currency.compute(self.currency, self.unit_price, + self.company.currency, round=False) else: unit_price = Uom.compute_price(self.product.default_uom, self.cost_price, self.uom)