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)