Skip to content
Snippets Groups Projects
Commit f5b21797 authored by mreficent's avatar mreficent
Browse files

[FIX] l10n_es: check if chart of account is installed in migration

In last added migration script in https://github.com/odoo/odoo/commit/b40216a8ae8fefd03311b2884e7b83644baac0a1

, the code assumes the chart of account of l10n_es is installed. But happens that you may have installed several l10n_* modules, including l10n_es, but not having the chart of l10n_es installed (you have installed the chart of another module).

In this case, then the update crashes because tax_ids is None and tuple(tax_ids) crashes!

closes odoo/odoo#78958

Signed-off-by: default avatarOlivier Colson <oco@odoo.com>
parent 880c32f9
No related branches found
No related tags found
No related merge requests found
...@@ -30,10 +30,11 @@ def migrate(cr, version): ...@@ -30,10 +30,11 @@ def migrate(cr, version):
# To run in a server action to fix issues on dbs with custom taxes, # To run in a server action to fix issues on dbs with custom taxes,
# replace the content of this dict. # replace the content of this dict.
taxes_mapping = { taxes_mapping = {}
tag_name: get_taxes_from_templates(template_names) for tag_name, template_names in taxes_mapping.items():
for tag_name, template_names in templates_mapping.items() taxes_from_templates = get_taxes_from_templates(template_names)
} if taxes_from_templates:
taxes_mapping[tag_name] = taxes_from_templates
old_tag = env.ref('l10n_es.mod_303_61') old_tag = env.ref('l10n_es.mod_303_61')
for tag_name, tax_ids in taxes_mapping.items(): for tag_name, tax_ids in taxes_mapping.items():
......
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