From 2d0e117678efa7abcb3f05a9e4ef8e4e8a93ca71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 28 Nov 2023 13:30:46 +0100 Subject: [PATCH] [IMP] payment: Copy the column provider to code from payment.provider Related to https://github.com/OCA/OpenUpgrade/pull/4179#discussion_r1407365126 --- .../scripts/payment/16.0.2.0/pre-migration.py | 5 +++++ .../scripts/payment/16.0.2.0/upgrade_analysis_work.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/openupgrade_scripts/scripts/payment/16.0.2.0/pre-migration.py b/openupgrade_scripts/scripts/payment/16.0.2.0/pre-migration.py index 72812edf3d16..21457b48dd83 100644 --- a/openupgrade_scripts/scripts/payment/16.0.2.0/pre-migration.py +++ b/openupgrade_scripts/scripts/payment/16.0.2.0/pre-migration.py @@ -69,6 +69,10 @@ ), ] +_columns_copies = { + "payment_provider": [("provider", "code", "varchar")], +} + _xmlid_renames = [ ( "payment.action_invoice_order_generate_link", @@ -210,4 +214,5 @@ def migrate(env, version): openupgrade.rename_models(env.cr, _model_renames) openupgrade.rename_tables(env.cr, _table_renames) openupgrade.rename_fields(env, _field_renames) + openupgrade.copy_columns(env.cr, _columns_copies) openupgrade.rename_xmlids(env.cr, _xmlid_renames) diff --git a/openupgrade_scripts/scripts/payment/16.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/payment/16.0.2.0/upgrade_analysis_work.txt index 9e72d4e78598..326a750a5444 100644 --- a/openupgrade_scripts/scripts/payment/16.0.2.0/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/payment/16.0.2.0/upgrade_analysis_work.txt @@ -62,6 +62,8 @@ payment / payment.icon / provider_ids (many2many) : NEW re payment / payment.provider / allow_express_checkout (boolean): NEW payment / payment.provider / available_country_ids (many2many): NEW relation: res.country payment / payment.provider / code (selection) : NEW required, selection_keys: ['none'], hasdefault: default +# DONE: pre-migration: copy the column provider to code + payment / payment.provider / express_checkout_form_view_id (many2one): NEW relation: ir.ui.view payment / payment.provider / is_published (boolean) : NEW payment / payment.provider / maximum_amount (float) : NEW