diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 4ed3ca33460..ef2840dbafe 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -8829,6 +8829,12 @@ msgstr "" msgid "Please define a payment method on your payment." msgstr "" +#. module: account +#: code:addons/account/models/chart_template.py:0 +#, python-format +msgid "Please first define a fiscal country for company %s." +msgstr "" + #. module: account #: code:addons/account/models/account_bank_statement.py:0 #, python-format diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index f9fcb59161a..8c83a33bf1b 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -1022,6 +1022,11 @@ class AccountTaxTemplate(models.Model): if self.chart_template_id.country_id: vals['country_id'] = self.chart_template_id.country_id.id + elif company.account_fiscal_country_id: + vals['country_id'] = company.account_fiscal_country_id.id + else: + # Will happen for generic CoAs such as syscohada (they are available for multiple countries, and don't have any country_id) + raise UserError(_("Please first define a fiscal country for company %s.", company.name)) tax_template_vals.append((template, vals)) else: