From 15eb4d8795a8a01ecac6152f647c2ee060ef4ec6 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 23 Dec 2021 12:39:31 +0100 Subject: [PATCH] [FIX] hr_expense: compute price unit in correct currency --- addons/hr_expense/models/hr_expense.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index b08d4dff9a9..ce5f93ddbac 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -222,9 +222,12 @@ class HrExpense(models.Model): for expense in self.filtered('product_id'): expense = expense.with_company(expense.company_id) expense.name = expense.name or expense.product_id.display_name - if not expense.attachment_number or (expense.attachment_number and not expense.unit_amount): - expense.unit_amount = expense.product_id.price_compute('standard_price')[expense.product_id.id] expense.product_uom_id = expense.product_id.uom_id + if not expense.attachment_number or (expense.attachment_number and not expense.unit_amount): + expense.unit_amount = expense.product_id.price_compute( + 'standard_price', + uom=expense.product_uom_id, + currency=expense.currency_id)[expense.product_id.id] expense.tax_ids = expense.product_id.supplier_taxes_id.filtered(lambda tax: tax.company_id == expense.company_id) # taxes only from the same company account = expense.product_id.product_tmpl_id._get_product_accounts()['expense'] if account: