Skip to content
Snippets Groups Projects
Commit 4b140806 authored by HuylenbroeckFlorent's avatar HuylenbroeckFlorent
Browse files

[FIX] Install l10n_eu_service without chart template


When installing l10n_eu_service without a localization installed, a line fails
in the get_oss_tags function of res_company, thus halting the installation
and returning an error.

This fail is due to the function relying on the company in self having its
'chart_template_id' set, when this is not always the case.

Adding a failsafe to that function allows the installation of the module to
proceed in the event that the chart_template_id is not set.

opw-3291118
opw-3289913

closes odoo/odoo#120077

Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
parent b5cf0a50
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,9 @@ class Company(models.Model):
return self.env.ref(f'l10n_eu_service.oss_tax_account_company_{self.id}')
def _get_oss_tags(self):
[chart_template_xml_id] = self.chart_template_id.parent_id.get_xml_id().values() or self.chart_template_id.get_xml_id().values()
chart_template_xml_id = ''
if self.chart_template_id:
[chart_template_xml_id] = self.chart_template_id.parent_id.get_external_id().values() or self.chart_template_id.get_external_id().values()
tag_for_country = EU_TAG_MAP.get(chart_template_xml_id, {
'invoice_base_tag': None,
'invoice_tax_tag': None,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment