Skip to content

[19.0][OU-FIX] account: drop stale l10n account.report.line xml_ids#18

Draft
dnplkndll wants to merge 1 commit into
19.0from
19.0-fix-account-report-line-split-l10n
Draft

[19.0][OU-FIX] account: drop stale l10n account.report.line xml_ids#18
dnplkndll wants to merge 1 commit into
19.0from
19.0-fix-account-report-line-split-l10n

Conversation

@dnplkndll
Copy link
Copy Markdown

Port: 18→19 of the account.report.line xml_ids that 19.0 reclassifies into account.report.expression. Without this, the first l10n module update after the schema split crashes with:

For external id <name> when trying to create/update a record of model
account.report.expression found record of different model
account.report.line

Scope: 5,233 stale xml_ids across 94 l10n modules in a Tier-1 600-module seed (top owners: l10n_es 588, l10n_ec 383, l10n_it 326, l10n_kr 222, l10n_lu 162, l10n_fr_account 132, l10n_br 126, l10n_ma 115; long tail through small-country modules). Zero non-l10n_ owners observed; the fix scopes module LIKE 'l10n_%%' as a safety belt.

Approach

Drop the stale account.report.line rows for l10n_* owners in pre-migration. The FK account_report_expression.report_line_id ON DELETE CASCADE auto-cleans dependent expressions; the l10n module update reinstalls both line and expression rows under the correct 19.0 model assignment via _load_records().

Non-mechanical adaptations worth flagging

  • Single helper in account/19.0.1.4/pre-migration.py, not per-l10n. The remap is uniform across all 94 affected modules — same xml_id prefix patterns, same model swap, same join key. Per-l10n alternatives would multiply boilerplate 94× without adding signal. account is the natural schema owner.
  • The over-deletion is intentional. Some tax_report_line_* xml_ids stay as account.report.line in 19.0 (hierarchical parents). Deleting and letting -u all reinstall is the same end-state as a selective remap, but trivially safer (no per-module XML parser, no parser bug surface). Lab Tier-1 seed validated round-trip: 5,233 pre-state → 5,949 lines + 6,580 expressions post-migration (numbers grow because 19.0 adds new report records).

Known acceptable consequence

account_report_external_value.carryover_origin_report_line_id is ON DELETE SET NULL. Carryover-display metadata for historical tax period continuity loses its origin link; values themselves are preserved, and re-establish as new periods accumulate on 19.0.

19.0 reclassifies many l10n_* tax-report xml_ids from
account.report.line to account.report.expression (leaf rows with
_base / _tax / _adj suffixes become expressions; hierarchical
parents stay as lines). The 18.0 ir_model_data still maps every
affected xml_id as account.report.line, so the 19.0 module update
crashes with `For external id <name> when trying to create/update
a record of model account.report.expression found record of
different model account.report.line`.

Drop the stale l10n_* lines in pre-migration. The FK
account_report_expression.report_line_id ON DELETE CASCADE auto-
cleans dependent expressions; the l10n module update reinstalls
both under the correct 19.0 model assignment via _load_records().
@dnplkndll dnplkndll changed the base branch from ledoent to 19.0 May 22, 2026 22:01
@dnplkndll dnplkndll closed this May 22, 2026
@dnplkndll dnplkndll reopened this May 22, 2026
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