From 3cbcacd2e1e38b60b052e080839cd58aa743f1af Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Wed, 17 Jun 2020 14:28:41 +0000 Subject: [PATCH] [FIX] account: fix access rights error when opening tax report - Use an User with Accounting access rights, but without Admin access rights (e.g. Marc Demo) - Go to Accounting > Reporting > Tax Report An access rights error is triggered. opw-2275552 opw-2275115 closes odoo/odoo#53184 X-original-commit: 517a13b967a07fe1e71b9c5308d185c4e45f1a2d Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/company.py b/addons/account/models/company.py index 853b2321252..bda2c1301ed 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -574,7 +574,7 @@ class ResCompany(models.Model): self.ensure_one() fiscal_country_key = 'account_fiscal_country_%s' % self.id - forced_country_code = self.env['ir.config_parameter'].get_param(fiscal_country_key) + forced_country_code = self.env['ir.config_parameter'].sudo().get_param(fiscal_country_key) forced_country = forced_country_code and self.env['res.country'].search([('code', 'ilike', forced_country_code)], limit=1) return forced_country or self.country_id