Skip to content
Snippets Groups Projects
Commit 5ffc7c63 authored by mreficent's avatar mreficent Committed by oco-odoo
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#79024

X-original-commit: f5b21797
Signed-off-by: default avatarOlivier Colson <oco@odoo.com>
parent ef2b1dd1
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,11 @@ def migrate(cr, version):
# To run in a server action to fix issues on dbs with custom taxes,
# replace the content of this dict.
taxes_mapping = {
tag_name: get_taxes_from_templates(template_names)
for tag_name, template_names in templates_mapping.items()
}
taxes_mapping = {}
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')
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