Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0 --> 14.0] Generation of account.fiscal.position.tax in l10n_es #4233

Closed
marielejeune opened this issue Nov 21, 2023 · 2 comments · Fixed by #4236
Closed

[13.0 --> 14.0] Generation of account.fiscal.position.tax in l10n_es #4233

marielejeune opened this issue Nov 21, 2023 · 2 comments · Fixed by #4236
Labels

Comments

@marielejeune
Copy link
Contributor

marielejeune commented Nov 21, 2023

Module

l10n_es

Describe the bug

During the migration from 13.0 to 14.0, Odoo updates the Spanish taxes in its 5.2 post-migrate script, by updating taxes from templates in l10n_es.account_chart_template_common. See https://github.com/odoo/odoo/blob/14.0/addons/l10n_es/migrations/5.2/post-migrate_update_taxes.py

This leads to psycopg2.errors.UniqueViolation errors because Odoo tries to create 2 times fiscal positions with same key (position_id, tax_src_id, tax_dest_id).
This comes from the fact that some templates are duplicated in DB. Here below is the list of duplicate ir.model.data.
In fact, these data were first defined in version 12 in OCA/l10n-spain/l10n_es_extra_data and then in version 13 in Odoo, but the XML ids are not the sames.
Here is the list of the XML ids differences (OCA version 12, Odoo version 13) :
fptt_recargo_0a, fptt_recargo_0b
fptt_extra_0a, fptt_extra_0b
fptt_extra_5a, fptt_extra_5b
fptt_recargo_buy_5a_2, fptt_recargo_buy_5b_2
fptt_intra_0a, fptt_intra_0b
fptt_recargo_buy_0a, fptt_recargo_buy_0b
fptt_recargo_0a_2, fptt_recargo_0b_2
fptt_intra_5a, fptt_intra_5b
fptt_recargo_buy_0a_2, fptt_recargo_buy_0b_2
fptt_recargo_5a, fptt_recargo_5b
fptt_recargo_buy_5a, fptt_recargo_buy_5b
fptt_recargo_5a_2, fptt_recargo_5b_2

It causes no bug up to migration to version 14 because these templates are not loaded before.

I'm not familiar with Spanish accounting but wondering why these duplicates (old OCA templates) were not removed in a 13.0 post-migration script?

To Reproduce

Affected versions: Migration from 12 to 14.

Steps to reproduce the behavior:

  1. Take a DB in version 12 with OCA/l10n-spain/l10n_es_extra_data installed
  2. Migrate to version 13.
  3. Try to migrate to version 14: bug in post-migration Odoo script of version 14.0.5.1.
@marielejeune
Copy link
Contributor Author

Maybe some Spanish contributors have experienced this and could help me? @pedrobaeza or some colleagues from ForgeFlow @MiquelRForgeFlow ?
Thanks a lot!

@pedrobaeza
Copy link
Member

There were migration scripts from v12 l10n_es_extra_data to l10n_es:

but it seems these ones are missing. Would you mind the PR with the extra renamings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants