From 54d846ab1c834add1fa7d588f97aa0fafe9e33b3 Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Mon, 28 Oct 2019 14:17:29 +0000 Subject: [PATCH] [FIX] account: tax report lines: use new syntax env.company instead of env.user.company_id to get the default country of a tax report line closes odoo/odoo#39471 X-original-commit: d62d4e198368a14dff50fd16f391f18c9ceec422 Signed-off-by: oco-odoo --- addons/account/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 4c0e24c9579..b4f5756fd2b 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -67,7 +67,7 @@ class AccountTaxReportLine(models.Model): name = fields.Char(string="Name", required=True, help="Complete name for this report line, to be used in report.") tag_ids = fields.Many2many(string="Tags", comodel_name='account.account.tag', relation='account_tax_report_line_tags_rel', help="Tax tags populating this line") - country_id = fields.Many2one(string="Country", comodel_name='res.country', required=True, default=lambda x: x.env.user.company_id.country_id.id, help="Country for which this line is available.") + country_id = fields.Many2one(string="Country", comodel_name='res.country', required=True, default=lambda x: x.env.company.country_id.id, help="Country for which this line is available.") report_action_id = fields.Many2one(string="Report Action", comodel_name='ir.actions.act_window', help="The optional action to call when clicking on this line in accounting reports.") children_line_ids = fields.One2many(string="Children Lines", comodel_name='account.tax.report.line', inverse_name='parent_id', help="Lines that should be rendered as children of this one") parent_id = fields.Many2one(string="Parent Line", comodel_name='account.tax.report.line')