From bef4a3bad6ba7ac84060eed1611076383cf46673 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 20 Feb 2020 14:40:41 +0000 Subject: [PATCH] [FIX] stock_landed_costs: multi-currency - Activate 2 currencies - Create a landed cost product - Create a Vendor Bill in a currency different from the company currency - Add the landed cost product - Click on 'Create Landed Costs' The landed cost is created in the company currency, but with the amounts in the vendor bill currency. This happens because the currency conversion is missing. opw-2200500 closes odoo/odoo#45861 X-original-commit: 41f52aef54ddf9ab4cd0f23c1224c2d7581a1ede Signed-off-by: Nicolas Martinelli (nim) --- addons/stock_landed_costs/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/models/account_move.py b/addons/stock_landed_costs/models/account_move.py index ae50e6d5ec5..e792c9512ab 100644 --- a/addons/stock_landed_costs/models/account_move.py +++ b/addons/stock_landed_costs/models/account_move.py @@ -31,7 +31,7 @@ class AccountMove(models.Model): 'product_id': l.product_id.id, 'name': l.product_id.name, 'account_id': l.product_id.product_tmpl_id.get_product_accounts()['stock_input'].id, - 'price_unit': l.price_subtotal, + 'price_unit': l.currency_id._convert(l.price_subtotal, l.company_currency_id, l.company_id, l.move_id.date), 'split_method': 'equal', }) for l in landed_costs_lines], })