[17.0][FIX] ptplus: scope the label/description swap to PT companies - #6
Open
eantones wants to merge 2 commits into
Open
[17.0][FIX] ptplus: scope the label/description swap to PT companies#6eantones 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.
Replaces #2, auto-closed by GitHub at the instant the fork base 17.0 was resynced to the vendor's new snapshot (the mirror publishes force-pushed orphan snapshots; a PR does not survive the jump regardless of push order — reopen is refused afterwards).
Same two commits, rebased clean onto snapshot ac8eba5d: (1) scope the 17.0 label/description swap to PT companies only (the vendor migration flattened per-language labels of non-PT taxes; 30/164 PT taxes lost their es_ES variant), (2) make the swap one SQL UPDATE over the whole translation jsonb (unit-proven byte-exact per language on a 08-v16-done clone). Local-only.