[19.0][MIG] l10n_fr: cleanup obsolete res.partner.siret + orphan form view#5632
[19.0][MIG] l10n_fr: cleanup obsolete res.partner.siret + orphan form view#5632dnplkndll wants to merge 1 commit into
Conversation
Add the merges introduced by today's PR series so the auto-built image includes them and the lab can `OPENUPGRADE_PULL_POLICY=always` again: - 19.0-fix-hr-null-write-date (OCA#5628) - 19.0-fix-loyalty-stale-mail-template-fields (OCA#5629) - 19.0-fix-hr-obsolete-fields-cleanup (OCA#5630) - 19.0-fix-partner-autocomplete-cleanup (OCA#5631) - 19.0-fix-l10n-fr-cleanup (OCA#5632) The companion lab repos.yaml is updated separately so local `make sync-repos` matches.
The 18.0 l10n_fr module added res.partner.siret (a French SIRET tax identifier) plus a partner form inheritance view (res_partner_form_l10n_fr) that exposed it. Both are DEL per upgrade_analysis.txt: res.partner.siret (char) : DEL ir.ui.view: res_partner_form_l10n_fr : DEL The script directory previously contained only the auto-generated upgrade_analysis.txt. The migration relied on Odoo's standard upgrade flow to clean up the DEL field and DEL view. That doesn't actually prune them — the stale ir_model_fields row and orphan view (with arch_db retaining <field name="siret"/>) survive, and trip cross-cutting view validation when later modules' data XML loads (reproduced on a fresh 18 → 19 install with the loyalty / hr / partner_autocomplete companion fixes applied — l10n_ae/data/account_tax_report_data.xml:3 then raises 'Field "siret" does not exist in model "res.partner"'). Add pre-migration cleanup_obsolete_l10n_fr_siret using openupgrade.delete_records_safely_by_xml_id over both the field xml_id and the view xml_id, plus a companion upgrade_analysis_work.txt annotating the analysis blocks.
354a2fc to
4f2aecd
Compare
|
Closing per maintainer guidance in #5631 (comment). Understood: OpenUpgrade aims to preserve previous information, the natural For the specific failure mode that motivated these PRs (cross-cutting view validation triggered by Thanks for the clear philosophical guidance — saved me from writing another 100+ similar PRs. |
|
You are welcome 😄 |
Add the merges introduced by today's PR series so the auto-built image includes them and the lab can `OPENUPGRADE_PULL_POLICY=always` again: - 19.0-fix-hr-null-write-date (OCA#5628) - 19.0-fix-loyalty-stale-mail-template-fields (OCA#5629) - 19.0-fix-hr-obsolete-fields-cleanup (OCA#5630) - 19.0-fix-partner-autocomplete-cleanup (OCA#5631) - 19.0-fix-l10n-fr-cleanup (OCA#5632) The companion lab repos.yaml is updated separately so local `make sync-repos` matches.
What
Add
openupgrade_scripts/scripts/l10n_fr/19.0.2.1/:pre-migration.pywithcleanup_obsolete_l10n_fr_siret(env)upgrade_analysis_work.txtannotating the analysis blocksThe pre-migration deletes the stale
ir_model_fieldsrow forres.partner.siretplus the orphan inheritance viewres_partner_form_l10n_fr. Both are marked DEL in the existingupgrade_analysis.txtbut were not actually pruned by Odoo's standardupgrade flow.
Why
The 18.0
l10n_frmodule addedres.partner.siret(the FrenchSIRET tax identifier) plus a partner form inheritance view that exposed
it. In 19.0 both are removed from source. The directory previously
contained only the auto-generated
upgrade_analysis.txt, so themigration relied on Odoo's standard upgrade flow to drop the DEL field
and DEL view. That doesn't actually happen — the rows survive and the
view's
arch_dbretains<field name=\"siret\"/>, which causescross-cutting view validation to raise:
```
Field "siret" does not exist in model "res.partner"
```
when any later module's data XML load triggers the validation.
Reproduced on a fresh 18.0 → 19.0 install (
odoo -i allthen-u all): the crash hits at module 217/608 (l10n_ae) whileparsing
l10n_ae/data/account_tax_report_data.xml:3, after theloyalty (#5629), hr (#5630), and partner_autocomplete
(#5631) companion fixes are applied.
How
cleanup_obsolete_l10n_fr_siret(env)lists the two known-obsoletexml_ids and passes them to
openupgrade.delete_records_safely_by_xml_id.That deletes the
ir_model_databackrefs + the underlyingir_model_fields/ir_ui_viewrecords together, falling back tonoupdate=Trueif a record can't be removed (per the helper'sexisting behaviour).
The companion
upgrade_analysis_work.txtannotates the field DEL andthe view DEL blocks with
# DONEcomments cross-referencing thehelper, and marks the remaining XML-records entries as
# NOTHING TO DO(the standard upgrade handles them: NEW view isauto-created, noupdate flip is standard, dom-tom group rename is in
apriori).
Test plan
companion fixes applied. Without this patch, migration crashes at
module 217/608 (
l10n_ae) on the siret field reference.l10n_fr-related crash. (Any subsequent failure is a different
module's analogous gap.)
Related
This fix continues the pattern surfaced by the comprehensive
CE-install benchmark: modules whose 19.0
upgrade_analysis.txtlistsDEL entries that Odoo's standard upgrade flow doesn't actually prune.
A separate small PR may be needed for
l10n_fr_accountwhich alsoDEL's a partner-form view (
res_partner_form_l10n_fr) on the sameanalysis — that script directory similarly contains only the
auto-generated analysis file.