Skip to content

feat(migrate): give former group taxes their children's accounts after 13.0 - #52

Merged
grojof merged 2 commits into
mainfrom
feat/group-tax-accounts
Sep 30, 2026
Merged

grojof merged 2 commits into
mainfrom
feat/group-tax-accounts

Conversation

@grojof

@grojof grojof commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Why

OpenUpgrade 13.0 (l10n_es 13.0.4.0) turns a localisation's group taxes (reverse charge, intra-community purchases) into one tax and takes its repartition lines' account from the group, which holds none. Existing journal items keep their accounts, but a bill posted after the migration puts both tax amounts on the expense account of its line. Reproduced on a clean 12.0 database with l10n_es and proposed upstream as OCA/OpenUpgrade#6047. account_chart_update fills the template's accounts only when run at 13.0; at 18.0 it stops on a tax already used.

What

  • odoo_dwg/grouptaxes.py: right after the 13.0 step, for a source up to 12.0, each tax repartition line without account of a tax with children takes the account of its child's repartition line (same document, repartition type and sign, as OpenUpgrade matches the journal items). Lines with an account are left, so with the upstream fix merged it writes nothing. Listed in logs/13.0-group-tax-accounts.tsv.
  • Spec migration-run (archived change 2026-09-30-keep-group-tax-accounts), docs, verifier tools/verify_group_tax_accounts.py.

Checks

  • python -m pytest -q, python -m ruff check ., openspec validate --specs: pass.
  • tools/verify_group_tax_accounts.py, tools/verify_generated_shell.py, tools/verify_migration_driver.py: pass.
  • On a clean l10n_es database migrated by stock OpenUpgrade 13.0, the repair leaves it identical to OpenUpgrade with the upstream fix; a second run writes nothing.
  • Real host, full run from the original copy: 60 lines on 15 taxes given 472/477, a new bill posts on them, every other repair and comparison unchanged, and account_chart_update then applies without error.

Assisted-by: Claude

…r 13.0

OpenUpgrade 13.0 turns a localisation's group taxes (reverse charge,
intra-community purchases) into one tax and takes its repartition lines'
account from the group, which holds none: a bill posted after the migration
puts both tax amounts on the expense account of its line. For a source up to
12.0, right after the 13.0 step, each such line takes the account of its
child's repartition line, matched by document, type and sign. Proposed
upstream as OCA/OpenUpgrade#6047; once OpenUpgrade sets them, nothing is
written.
@grojof
grojof merged commit 25148ec into main Sep 30, 2026
@grojof
grojof deleted the feat/group-tax-accounts branch September 30, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant