Skip to content

[19.0][MIG] pos_viva_com: rename 9 viva_wallet_* fields to viva_com_*#5644

Open
dnplkndll wants to merge 2 commits into
OCA:19.0from
ledoent:19.0-mig-pos-viva-com-rename
Open

[19.0][MIG] pos_viva_com: rename 9 viva_wallet_* fields to viva_com_*#5644
dnplkndll wants to merge 2 commits into
OCA:19.0from
ledoent:19.0-mig-pos-viva-com-rename

Conversation

@dnplkndll
Copy link
Copy Markdown

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

Old (18.0, on pos_viva_wallet) New (19.0, on pos_viva_com)
viva_wallet_merchant_id viva_com_merchant_id
viva_wallet_api_key viva_com_api_key
viva_wallet_client_id viva_com_client_id
viva_wallet_client_secret viva_com_client_secret
viva_wallet_terminal_id viva_com_terminal_id
viva_wallet_bearer_token viva_com_bearer_token
viva_wallet_oauth_token viva_com_oauth_token
viva_wallet_webhook_verification_key viva_com_webhook_verification_key
viva_wallet_latest_response viva_com_latest_response

Migration

  • pre-migration.py — `openupgradelib.rename_fields` for all 9 fields. Note the model on both sides is `pos.payment.method`; only the field names changed.
  • No post-migration — `rename_fields` is a full move (column + ir.model.fields + ir.model.data), nothing left to do.

What this PR does NOT touch

  • NEW `pos.payment.viva_com_session_id` — additive transient-style char, no preservation needed.

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.

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels May 18, 2026
dnplkndll added 2 commits May 18, 2026 21:16
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).
@dnplkndll dnplkndll force-pushed the 19.0-mig-pos-viva-com-rename branch from 1815ce3 to f7011a6 Compare May 19, 2026 01:16
@dnplkndll dnplkndll marked this pull request as ready for review May 19, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants