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

[FIX] Install l10n_eu_oss without chart template


When installing l10n_eu_oss 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#120104

X-original-commit: 4b140806
Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: default avatarHuylenbroeck Florent (flhu) <flhu@odoo.com>
parent 710a2b2a
Branches
Tags
No related merge requests found
......@@ -127,7 +127,9 @@ class Company(models.Model):
def _get_oss_tags(self):
oss_tag = self.env.ref('l10n_eu_oss.tag_oss')
[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.
Please register or to comment