From 4a54a0dcb5432eda8912d7c03c708a047d6fa4a9 Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Mon, 9 Aug 2021 08:05:15 +0000 Subject: [PATCH] [FIX] hr_expense: convert base amount if different currency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a multi-currencies environment, if the user creates an expense with a different currency than the company's, one of the associated account move lines will have an incorrect base amount. To reproduce the issue: (Need account_accountant. Let USD be the company's currency) 1. In Settings, enable "Multi-Currencies" 2. Edit the currency rates: - EUR: 2 - USD: 1 3. Create an expense: - Currency: EUR - Unit Price: 700 - tax: 15% 4. Create Report, Submit, Approve, Post Journal Entries 5. Accounting > Reporting > Tax Report, This Financial Year 6. Audit of "Tax 15.00%" Error: Base amount of the expense is $700, which is incorrect. It should be either 700€ or $350 OPW-2613547 closes odoo/odoo#75264 X-original-commit: d6fd7301291dfe3ffd58d33edb3f2c4270e3b8a1 Signed-off-by: Yannick Tivisse (yti) Signed-off-by: Adrien Widart --- addons/hr_expense/models/hr_expense.py | 1 + addons/hr_expense/tests/test_expenses.py | 69 ++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 7407182375b..5ef8984c873 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -555,6 +555,7 @@ Or send your receipts at