From 08cc5fe8992dc8d1f6250c923f49d15d77b59019 Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Fri, 30 Jun 2023 17:06:41 +0200 Subject: [PATCH 1/2] Document rename of payment_transfer to payment_custom --- docsource/modules150-160.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 63c0d46657fc..9c55d765b82c 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -552,7 +552,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | payment_buckaroo | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| |new| payment_custom | | | +| |new| payment_custom |Done |Renamed from payment_transfer. | +-------------------------------------------------+----------------------+-------------------------------------------------+ | |new| payment_demo | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ @@ -576,7 +576,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | payment_stripe | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| |del| payment_transfer | | | +| |del| payment_transfer |Done |Renamed to payment_custom. | +-------------------------------------------------+----------------------+-------------------------------------------------+ | phone_validation | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ From 9cbdbef447cd70b5c75e8e1679e5266e00d33d4b Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Fri, 30 Jun 2023 17:41:51 +0200 Subject: [PATCH 2/2] Do the migration work for payment_custom --- .../payment_custom/16.0.2.0/post-migration.py | 22 +++++++++++++++ .../16.0.2.0/upgrade_analysis_work.txt | 27 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 openupgrade_scripts/scripts/payment_custom/16.0.2.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/payment_custom/16.0.2.0/upgrade_analysis_work.txt diff --git a/openupgrade_scripts/scripts/payment_custom/16.0.2.0/post-migration.py b/openupgrade_scripts/scripts/payment_custom/16.0.2.0/post-migration.py new file mode 100644 index 000000000000..5cd04d2b74fa --- /dev/null +++ b/openupgrade_scripts/scripts/payment_custom/16.0.2.0/post-migration.py @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2023 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # The payment migration script renames provider.acquirer to + # payment.provider. Assume that that script has already been run. + + # The provider (Selection) field no longer exists. The same information is + # now in custom_mode. + openupgrade.logged_query( + env.cr, + """ + UPDATE payment_provider + SET code = 'custom', custom_mode = 'wire_transfer' + WHERE provider = 'transfer' + """, + ) diff --git a/openupgrade_scripts/scripts/payment_custom/16.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/payment_custom/16.0.2.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..039120f0840b --- /dev/null +++ b/openupgrade_scripts/scripts/payment_custom/16.0.2.0/upgrade_analysis_work.txt @@ -0,0 +1,27 @@ +# A global note: This module was renamed from payment_transfer. + +---Models in module 'payment_custom'--- +---Fields in module 'payment_custom'--- +payment_custom / payment.provider / code (False) : NEW selection_keys: ['adyen', 'alipay', 'aps', 'asiapay', 'authorize', 'buckaroo', 'custom', 'none'], mode: modify +# DONE: post-migration: moved from payment.acquirer 'provider' field. + +payment_custom / payment.provider / custom_mode (selection) : NEW selection_keys: ['wire_transfer'] +# DONE: post-migration: moved from payment.acquirer 'provider' field. + +payment_custom / payment.provider / qr_code (boolean) : NEW +# NOTHING TO DO: Model is renamed in payment migration. Field name is identical. + +---XML records in module 'payment_custom'--- +NEW ir.model.constraint: payment_custom.constraint_payment_provider_custom_providers_setup +# NOTHING TO DO: New. + +NEW ir.ui.view: payment_custom.custom_transaction_status +# NOTHING TO DO: Renamed from payment_transfer.transfer_transaction_status +# with minimal changes. + +NEW ir.ui.view: payment_custom.payment_provider_form +# NOTHING TO DO: Renamed from payment_transfer.payment_acquirer_form with +# minimal changes. + +NEW ir.ui.view: payment_custom.redirect_form +# NOTHING TO DO: Renamed from payment_transfer with no changes.