Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_iq | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_it | | |
| l10n_it |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_it_edi | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
51 changes: 51 additions & 0 deletions openupgrade_scripts/scripts/l10n_it/19.0.0.9/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from openupgradelib import openupgrade

# l10n_it_edi_withholding is being folded into l10n_it in 19.0 (the
# withholding-tax module's records consolidate into the base l10n_it
# Italian-localization module). The 10 records below ship in l10n_it's
# 19.0 data files but had their 18.0 ir_model_data rows under
# module='l10n_it_edi_withholding'.
#
# Without renaming the xmlids in pre-migration, the Odoo install would
# create fresh ir_model_data rows pointing at new res_ids — the legacy
# rows would dangle, and customer references to the previous
# tax-report records (e.g. report-line tags attached to specific
# account.tax records via tag_ids) would be orphaned.
#
# Source: upgrade_analysis.txt — "renamed from l10n_it_edi_withholding
# module" lines.
#
# NOTE: this version of l10n_it also contains a large standard
# tax-report refactor (100+ DEL / 50+ NEW account.report.line and
# account.report.expression records under l10n_it own xmlids). Those
# are handled by the standard module-upgrade flow and don't need
# pre-migration logic — they're not the subject of this script.
# See openupgrade/TODO.md §4.3.1 for the broader campaign note.

_renamed_xmlids = [
("l10n_it_edi_withholding.withh_tax_report_it",
"l10n_it.withh_tax_report_it"),
("l10n_it_edi_withholding.withh_tax_report_balance",
"l10n_it.withh_tax_report_balance"),
("l10n_it_edi_withholding.enasarco_purchase_tax_report_it_line_tag",
"l10n_it.enasarco_purchase_tax_report_it_line_tag"),
("l10n_it_edi_withholding.enasarco_sale_tax_report_it_line_tag",
"l10n_it.enasarco_sale_tax_report_it_line_tag"),
("l10n_it_edi_withholding.withh_purchase_tax_report_it_line_tag",
"l10n_it.withh_purchase_tax_report_it_line_tag"),
("l10n_it_edi_withholding.withh_sale_tax_report_it_line_tag",
"l10n_it.withh_sale_tax_report_it_line_tag"),
("l10n_it_edi_withholding.enasarco_purchase_tax_report_it_line",
"l10n_it.enasarco_purchase_tax_report_it_line"),
("l10n_it_edi_withholding.enasarco_sale_tax_report_it_line",
"l10n_it.enasarco_sale_tax_report_it_line"),
("l10n_it_edi_withholding.withh_purchase_tax_report_it_line",
"l10n_it.withh_purchase_tax_report_it_line"),
("l10n_it_edi_withholding.withh_sale_tax_report_it_line",
"l10n_it.withh_sale_tax_report_it_line"),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(env.cr, _renamed_xmlids)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---Models in module 'l10n_it'---
---Fields in module 'l10n_it'---
l10n_it / account.tax / l10n_it_law_reference (char) : DEL

# NOTHING TO DO: legacy law-reference char on account.tax; the 19.0 chart
# template doesn't re-create it and the value is purely informational
# (operator-set descriptive text). Standard module-upgrade flow handles
# the column drop — if a customer wants to preserve the value before
# database_cleanup removes it, they can do so as a separate one-time
# script.

---XML records in module 'l10n_it'---

# DONE — the 10 xmlid renames from l10n_it_edi_withholding to l10n_it
# (withholding-tax module folded into the base l10n_it module). Handled
# in pre-migration.py via openupgrade.rename_xmlids. Without this,
# customer references to the previous tax-report records (e.g. tag_ids
# on account.tax pointing at the withholding line definitions) would be
# orphaned when Odoo's 19.0 install creates fresh ir_model_data rows
# pointing at new res_ids.

NEW account.report: l10n_it.withh_tax_report_it [renamed from l10n_it_edi_withholding module]
NEW account.report.column: l10n_it.withh_tax_report_balance [renamed from l10n_it_edi_withholding module]
NEW account.report.expression: l10n_it.enasarco_purchase_tax_report_it_line_tag [renamed from l10n_it_edi_withholding module]
NEW account.report.expression: l10n_it.enasarco_sale_tax_report_it_line_tag [renamed from l10n_it_edi_withholding module]
NEW account.report.expression: l10n_it.withh_purchase_tax_report_it_line_tag [renamed from l10n_it_edi_withholding module]
NEW account.report.expression: l10n_it.withh_sale_tax_report_it_line_tag [renamed from l10n_it_edi_withholding module]
NEW account.report.line: l10n_it.enasarco_purchase_tax_report_it_line [renamed from l10n_it_edi_withholding module]
NEW account.report.line: l10n_it.enasarco_sale_tax_report_it_line [renamed from l10n_it_edi_withholding module]
NEW account.report.line: l10n_it.withh_purchase_tax_report_it_line [renamed from l10n_it_edi_withholding module]
NEW account.report.line: l10n_it.withh_sale_tax_report_it_line [renamed from l10n_it_edi_withholding module]

# NOTHING TO DO — broader tax-report refactor. The rest of this analysis
# file documents a substantial 19.0 restructuring of the IT VAT tax
# report under l10n_it's own xmlids: ~50 NEW account.report.expression /
# account.report.line records, ~110 DEL of the previous report rows.
# All of these are standard module-data XML — the NEW records install,
# the DEL records are removed by Odoo's standard module-upgrade flow.
# No customer data references the lines directly (they're report-shape
# definitions, not data rows). No migration logic needed.
Loading