Skip to content

[OU-ADD] l10n_in_ewaybill: model move + credentials rename + account.move data conversion#36

Draft
dnplkndll wants to merge 1 commit into
19.0from
19.0-mig-l10n_in_ewaybill-pre-migration
Draft

[OU-ADD] l10n_in_ewaybill: model move + credentials rename + account.move data conversion#36
dnplkndll wants to merge 1 commit into
19.0from
19.0-mig-l10n_in_ewaybill-pre-migration

Conversation

@dnplkndll
Copy link
Copy Markdown

@dnplkndll dnplkndll commented May 26, 2026

l10n_in_ewaybill 19.0 absorbs functionality from two 18.0 modules:

  1. l10n_in_edi_ewaybill is in apriori.renamed_modules — base's pre-migration runs update_module_names so ir_module_module + ir_model_data references rewrite automatically.

  2. l10n_in_ewaybill_stock keeps its name but the l10n.in.ewaybill + l10n.in.ewaybill.cancel models MOVE OUT to l10n_in_ewaybill. Table name unchanged; model ownership transfers via update_module_moved_models.

Pre-migration

  • update_module_moved_models × 2 (l10n.in.ewaybill + .cancel).
  • rename_xmlids × 6 (action, report, 2 access rules, ir.rule, paperformat moving from stock).
  • rename_fields × 3 res.company credentials columns (drop the _edi_ segment from the prefix).
  • rename_columns × 8 on account.move (preserve as openupgrade_legacy_19_0_* so the columns survive update_db).

Post-migration

For each account.move with non-NULL legacy ewaybill data, INSERT one l10n.in.ewaybill row capturing the 8 transport fields. account_move_id wires the link.

  • state='pending' (the 19.0 default). The 18.0 schema didn't track ewaybill-API status separately, so the operator re-fetches from the gov portal after migration if reconciliation is needed.
  • The 18.0 mode key '0' is dropped in 19.0; coerced to NULL on insert. All other selection keys ('1'..'4', 'O'/'R') overlap cleanly.

docsource status set to Done. Verified end-to-end on the openupgrade-lab clean 18.0 prod seed (the seed doesn't ship the ewaybill modules so the new code runs as a no-op — both the pre's column rename and the post's INSERT trigger on empty result sets safely).

Draft fork PR — for review before upstreaming to OCA/OpenUpgrade.

dnplkndll added a commit that referenced this pull request May 26, 2026
…s from account.move ewaybill data (Done)

Completes the migration that #36 left Partial. The 8 ewaybill fields
that lived on account.move in 18.0 (l10n_in_distance, _mode,
_transportation_doc_date, _transportation_doc_no, _transporter_id,
_type_id, _vehicle_no, _vehicle_type) are now preserved in
pre-migration and replayed into l10n.in.ewaybill rows in post-migration.

Pre-migration adds:
 - rename_columns on the 8 account.move columns → openupgrade_legacy_19_0_*
   so Odoo's update_db doesn't drop them before post-migration runs.

Post-migration:
 - For each account.move with non-NULL legacy ewaybill data, INSERT one
   l10n.in.ewaybill row. account_move_id wires the link; the 8 fields
   copy across directly into the new model's same-named columns.
 - state='pending' (the 19.0 default) — the 18.0 schema didn't track
   ewaybill-API status separately, so the operator re-fetches from the
   e-Waybill gov portal after migration if reconciliation is needed.
 - The 18.0 mode key '0' is dropped in 19.0; coerced to NULL on insert
   (operator marks the row after the fact). All other selection keys
   ('1'..'4', 'O'/'R') overlap cleanly.

docsource flips from 'Partial' to 'Done'.
@dnplkndll dnplkndll force-pushed the 19.0-mig-l10n_in_ewaybill-pre-migration branch from 856a545 to d42f7ac Compare May 26, 2026 12:12
@dnplkndll dnplkndll changed the title [19.0][OU-ADD] l10n_in_ewaybill: model move from l10n_in_ewaybill_stock + credentials rename (Partial) [19.0][OU-ADD] l10n_in_ewaybill: model move + credentials rename + account.move data conversion May 26, 2026
@dnplkndll dnplkndll changed the title [19.0][OU-ADD] l10n_in_ewaybill: model move + credentials rename + account.move data conversion [OU-ADD] l10n_in_ewaybill: model move + credentials rename + account.move data conversion May 26, 2026
…move data conversion

l10n_in_ewaybill 19.0 absorbs from two 18.0 modules: l10n_in_edi_ewaybill
(handled by apriori.renamed_modules) and the l10n.in.ewaybill model
moving out of l10n_in_ewaybill_stock (which keeps its name).

Pre-migration:
 - update_module_moved_models x 2 (l10n.in.ewaybill + .cancel).
 - rename_xmlids x 6 (action, report, 2 access, ir.rule, paperformat
   from stock).
 - rename_fields x 3 res.company credentials (drop the '_edi_' segment).
 - rename_columns x 8 account.move ewaybill columns -> legacy names so
   post-migration can replay them.

Post-migration: INSERT one l10n.in.ewaybill row per account.move with
non-NULL legacy data, state='pending'. mode='0' coerced to NULL (18.0
key dropped in 19.0).
@dnplkndll dnplkndll force-pushed the 19.0-mig-l10n_in_ewaybill-pre-migration branch from d42f7ac to 926c0c8 Compare May 26, 2026 16:54
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