From 570e2b31058e6fe1895a3552a568cc8e9ff5d3a5 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 20 Feb 2020 16:35:17 +0000 Subject: [PATCH] [FIX] hr_expense: ensure properties are read with the correct company. --- addons/hr_expense/models/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 30609550592..36dd494cea0 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -154,7 +154,7 @@ class HrExpense(models.Model): self.unit_amount = self.product_id.price_compute('standard_price')[self.product_id.id] self.product_uom_id = self.product_id.uom_id self.tax_ids = self.product_id.supplier_taxes_id.filtered(lambda tax: tax.company_id == self.company_id) # taxes only from the same company - account = self.product_id.product_tmpl_id._get_product_accounts()['expense'] + account = self.product_id.product_tmpl_id.with_company(self.company_id)._get_product_accounts()['expense'] if account: self.account_id = account