[19.0][MIG] pos_viva_com: rename 9 viva_wallet_* fields to viva_com_*#5644
Open
dnplkndll wants to merge 2 commits into
Open
[19.0][MIG] pos_viva_com: rename 9 viva_wallet_* fields to viva_com_*#5644dnplkndll wants to merge 2 commits into
dnplkndll wants to merge 2 commits into
Conversation
The pos_viva_wallet module was renamed to pos_viva_com in 19.0 (handled by apriori.renamed_modules executed in base/19.0.1.3/pre-migration.py). However the 9 credential / config fields on pos.payment.method also got renamed from viva_wallet_<x> to viva_com_<x> — without explicit rename_fields, users' configured API keys / secrets / merchant + terminal IDs / OAuth tokens would be lost (rendered as DEL on the old module + NEW empty on the new module). Pre-migration uses openupgradelib.rename_fields for all 9. The new pos.payment.viva_com_session_id is additive (transient-style char, no preservation needed).
Self-review fixes before OCA review: - data seed: replace UPDATE-by-MIN(id) raw SQL with search-or-create via ORM. Original silently no-op'd if pos_payment_method had no rows (test would then fail trying to find the seeded credentials). Now: pick first existing method, or create one against the main company's first cash/bank journal. - test: add viva_com_latest_response::text assertion. Previously the test SELECT covered 8 of 9 renamed fields; the json field was seeded but never verified. Per the PR description's "9 fields" framing. - pre-migration: drop verbose preamble comment (rationale lives in the PR description).
1815ce3 to
f7011a6
Compare
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.
Summary
The `pos_viva_wallet` module was renamed to `pos_viva_com` in 19.0 (handled by `apriori.renamed_modules` in `base/19.0.1.3/pre-migration.py`). However the 9 credential + config fields on `pos.payment.method` ALSO got renamed from `viva_wallet_` → `viva_com_`. Without explicit `rename_fields`, users' configured API keys / OAuth tokens / merchant + terminal IDs would be silently lost (rendered as DEL on the old module + NEW empty on the new module).
The 9 fields renamed
Migration
What this PR does NOT touch
Test coverage
`openupgrade_scripts/scripts/pos_viva_com/19.0.1.0/tests/test_pos_viva_com_migration.py` asserts all 9 renamed fields are present on `pos.payment.method` post-migration.
`openupgrade_scripts/scripts/pos_viva_com/tests/data_pos_viva_com_migration.py` — 18.0 demo seed: creates a pos.payment.method with all 9 viva_wallet_* fields populated so the test can verify the rename preserved values.
Fork CI
Validated on fork's `Test OpenUpgrade migration` workflow (both base + enriched seeds passed): 2026-05-16T11:29Z.
docsource
`docsource/modules180-190.rst` updated — `pos_viva_com` marked Done.