From e85b5c875c280e46011cdeea513feb85a8399456 Mon Sep 17 00:00:00 2001 From: Mitali Patel Date: Tue, 20 Aug 2019 09:28:31 +0000 Subject: [PATCH] [FIX] l10n_*: use company from environment previously, with multi-company setup, when we switch company from top right corner, that company was set as current user's main company. But with commit a5b6f31cf28e5381e1c85f66730bcdb55998e643 it no more changes current user's company but updates 'company' property of environment for specific browser tab. So, env.user.company_id has to be replaced with env.company. Task: 2052484 Closes: 35851 closes odoo/odoo#35851 Signed-off-by: Quentin De Paoli (qdp) --- addons/l10n_be_edi/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_be_edi/models/account_invoice.py b/addons/l10n_be_edi/models/account_invoice.py index e70ab5fddb1..66b82756ada 100644 --- a/addons/l10n_be_edi/models/account_invoice.py +++ b/addons/l10n_be_edi/models/account_invoice.py @@ -162,7 +162,7 @@ class AccountMove(models.Model): elements = etax.xpath('cbc:Percent', namespaces=namespaces) if elements: tax = self.env['account.tax'].search([ - ('company_id', '=', self.env.user.company_id.id), + ('company_id', '=', self.env.company.id), ('amount', '=', float(elements[0].text)), ('type_tax_use', '=', invoice_form.journal_id.type), ], order='sequence ASC', limit=1)