[17.0][FIX] ptplus: scope the 17.0 label/description swap to PT companies - #2
Open
eantones wants to merge 2 commits into
Open
[17.0][FIX] ptplus: scope the 17.0 label/description swap to PT companies#2eantones wants to merge 2 commits into
eantones wants to merge 2 commits into
Conversation
The 17.0.4.4.0 pre-migration swaps invoice_label <-> description to restore the PT localization's semantics after OpenUpgrade's account 17.0.1.2 rename (description -> invoice_label). It ran on search([]) -- every tax of every company -- so on a multi-localization database it also swapped the taxes of non-Portuguese companies, wiping their invoice labels (invoice_label <- the freshly recreated, empty description field) and misplacing the label text in description. Scope the swap to the companies actually running the Portuguese localization, identified by company country. chart_template is not usable at this point of the migration: vendor chart codes are not remapped yet and read NULL.
The 17.0.4.4.0 swap used an ORM read/write pair (tax.description /
tax.invoice_label), which resolves translatable fields in the context
language only: every other language's variant is dropped on write. On a
14->18 migration 30 of 164 PT taxes carried a diverging es_ES label
variant ("RET 25%" vs "RF 25%" elsewhere) and lost it at this door -
surfaced by a per-language relocation audit, invisible to any
single-language comparison.
Replace the loop with one SQL UPDATE swapping the two jsonb columns
wholesale (the right-hand side of an UPDATE reads the OLD row values, so
the assignments are a true simultaneous swap), scoped to PT-country
companies as before. Unit-proven on a clone of the pre-door snapshot:
164/164 PT per-language signatures preserved byte-exact, PT invoice_label
emptied, 0 non-PT rows touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 17.0.4.4.0 pre-migration swaps
invoice_label <-> descriptionto restore the PT localization's semantics after OpenUpgrade's account 17.0.1.2 rename (description -> invoice_label). It runs onsearch([])— every tax of every company — so on a multi-localization database it also swaps the taxes of non-Portuguese companies, wiping their invoice labels (invoice_label<- the freshly recreated, emptydescriptionfield) and misplacing the label text indescription.Scope the swap to the companies actually running the Portuguese localization, identified by company country.
chart_templateis not usable at this point of the migration: vendor chart codes are not remapped yet and read NULL.Found on a 14->18 migration of a multi-company DB (9 ES companies + 1 PT): after the 16->17 hop,
invoice_labelwas NULL on all 2412 taxes. To be reported to the vendor (Exo) as well.Note: the vendor mirror is bot-published with force-pushed orphan snapshots per release — when exo 17.0 head moves past
400562b, rebase this branch onto the new snapshot (rebase operativa; unrelated histories won't merge).