From a3a82a3e331eed3eab93940c63a8a9eb0ec26bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 31 Mar 2013 23:35:12 +0200 Subject: [PATCH] Add missing currency convertion in _get_account_stock_move_lines issue3101 review741003 --- stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stock.py b/stock.py index b7cb1e2797..22084f1974 100644 --- a/stock.py +++ b/stock.py @@ -157,13 +157,15 @@ class Move: def _get_account_stock_move_lines(self, type_): pool = Pool() AccountMoveLine = pool.get('account.move.line') + Currency = pool.get('currency.currency') move_lines = super(Move, self)._get_account_stock_move_lines(type_) if (type_.startswith('in_') and self.unit_shipment_cost and self.shipment and self.shipment.carrier): - shipment_cost = self.company.currency.round( - Decimal(str(self.quantity)) * self.unit_shipment_cost) + shipment_cost = Currency.compute(self.currency, + Decimal(str(self.quantity)) * self.unit_shipment_cost, + self.company.currency) shipment_cost_account = \ self.shipment.carrier.carrier_product.account_expense_used account = self.product.account_stock_supplier_used