From 7a985d381161f611a6756435a811df3eeb85fb05 Mon Sep 17 00:00:00 2001 From: Martin Varela Date: Mon, 4 Nov 2024 17:31:15 -0300 Subject: [PATCH 1/5] [17.0][OU-ADD] account_payment: migrate to 17.0 --- docsource/modules160-170.rst | 2 +- .../17.0.2.0/post-migration.py | 13 +++++++++++ .../account_payment/17.0.2.0/pre-migration.py | 15 ++++++++++++ .../17.0.2.0/upgrade_analysis_work.txt | 23 +++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst index 98e6778dc37d..ff6488413500 100644 --- a/docsource/modules160-170.rst +++ b/docsource/modules160-170.rst @@ -24,7 +24,7 @@ Module coverage 16.0 -> 17.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | account_lock | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| account_payment | | | +| account_payment | Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | |del| account_payment_invoice_online_payment_patch| |Merged into account_payment. | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py new file mode 100644 index 000000000000..5f6eb4b6cf9d --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py @@ -0,0 +1,13 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_deleted_xml_records = ['account_payment.payment_transaction_billing_rule'] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.delete_records_safely_by_xml_id( + env, + _deleted_xml_records, + ) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py new file mode 100644 index 000000000000..341a02ff1cad --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py @@ -0,0 +1,15 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_xmlid_renames = [ + ( + "account_payment_invoice_online_payment_patch.enable_portal_payment", + "account_payment.enable_portal_payment", + ), +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_xmlids(env.cr, _xmlid_renames) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..c61f99536cc2 --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt @@ -0,0 +1,23 @@ +---Models in module 'account_payment'--- +---Fields in module 'account_payment'--- +---XML records in module 'account_payment'--- +NEW ir.config_parameter: account_payment.enable_portal_payment [renamed from account_payment_invoice_online_payment_patch module] (noupdate) +DEL ir.config_parameter: account_payment_invoice_online_payment_patch.enable_portal_payment [renamed to account_payment module] (noupdate) +# DONE pre-migration rename XML-IDs + +NEW ir.model.access: account_payment.payment_transaction_user [renamed from payment module] +# NOTHING TO DO + +DEL ir.rule: account_payment.payment_transaction_billing_rule (noupdate) +# DONE: removed in post-migration + +NEW ir.ui.menu: account_payment.payment_method_menu +DEL ir.ui.menu: account_payment.payment_icon_menu +NEW ir.ui.view: account_payment.res_config_settings_view_form +DEL ir.ui.view: account_payment.payment_checkout_inherit +DEL ir.ui.view: account_payment.payment_manage_inherit +DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_invoice_page_inherit_payment +DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_my_invoices_payment +DEL ir.ui.view: account_payment_invoice_online_payment_patch.res_config_settings_view_form +NEW onboarding.onboarding.step: account_payment.onboarding_onboarding_step_payment_provider (noupdate) +# NOTHING TO DO \ No newline at end of file From ff0d68f36627f1ed1c1784dae81ad1e488f95f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20G=C3=B3mez=20Le=C3=B3n=20=28SISINFO=29?= Date: Mon, 4 Nov 2024 18:08:05 -0300 Subject: [PATCH 2/5] [OU-FIX] account_payment: add newline at end of file upgrade_analysis_work.txt --- .../scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt index c61f99536cc2..3f9c850eeaa6 100644 --- a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt @@ -20,4 +20,4 @@ DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_invoice_page DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_my_invoices_payment DEL ir.ui.view: account_payment_invoice_online_payment_patch.res_config_settings_view_form NEW onboarding.onboarding.step: account_payment.onboarding_onboarding_step_payment_provider (noupdate) -# NOTHING TO DO \ No newline at end of file +# NOTHING TO DO From e70a70081b9bd1e5c1c5a8e14637e243e6135c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20G=C3=B3mez=20Le=C3=B3n=20=28SISINFO=29?= Date: Mon, 4 Nov 2024 18:18:03 -0300 Subject: [PATCH 3/5] [OU-FIX] account_payment: add double quotes --- .../scripts/account_payment/17.0.2.0/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py index 5f6eb4b6cf9d..ba65c4166202 100644 --- a/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py @@ -2,7 +2,7 @@ from openupgradelib import openupgrade -_deleted_xml_records = ['account_payment.payment_transaction_billing_rule'] +_deleted_xml_records = ["account_payment.payment_transaction_billing_rule"] @openupgrade.migrate() From 550c6e37592b32cc1275197cc639eb5309c28c07 Mon Sep 17 00:00:00 2001 From: Martin Varela Date: Mon, 4 Nov 2024 17:31:15 -0300 Subject: [PATCH 4/5] [17.0][OU-ADD] account_payment: migrate to 17.0 --- docsource/modules160-170.rst | 2 +- .../17.0.2.0/post-migration.py | 13 +++++++++++ .../account_payment/17.0.2.0/pre-migration.py | 15 ++++++++++++ .../17.0.2.0/upgrade_analysis_work.txt | 23 +++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst index 98e6778dc37d..ff6488413500 100644 --- a/docsource/modules160-170.rst +++ b/docsource/modules160-170.rst @@ -24,7 +24,7 @@ Module coverage 16.0 -> 17.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | account_lock | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| account_payment | | | +| account_payment | Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | |del| account_payment_invoice_online_payment_patch| |Merged into account_payment. | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py new file mode 100644 index 000000000000..ba65c4166202 --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/post-migration.py @@ -0,0 +1,13 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_deleted_xml_records = ["account_payment.payment_transaction_billing_rule"] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.delete_records_safely_by_xml_id( + env, + _deleted_xml_records, + ) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py new file mode 100644 index 000000000000..341a02ff1cad --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py @@ -0,0 +1,15 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_xmlid_renames = [ + ( + "account_payment_invoice_online_payment_patch.enable_portal_payment", + "account_payment.enable_portal_payment", + ), +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_xmlids(env.cr, _xmlid_renames) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..3f9c850eeaa6 --- /dev/null +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt @@ -0,0 +1,23 @@ +---Models in module 'account_payment'--- +---Fields in module 'account_payment'--- +---XML records in module 'account_payment'--- +NEW ir.config_parameter: account_payment.enable_portal_payment [renamed from account_payment_invoice_online_payment_patch module] (noupdate) +DEL ir.config_parameter: account_payment_invoice_online_payment_patch.enable_portal_payment [renamed to account_payment module] (noupdate) +# DONE pre-migration rename XML-IDs + +NEW ir.model.access: account_payment.payment_transaction_user [renamed from payment module] +# NOTHING TO DO + +DEL ir.rule: account_payment.payment_transaction_billing_rule (noupdate) +# DONE: removed in post-migration + +NEW ir.ui.menu: account_payment.payment_method_menu +DEL ir.ui.menu: account_payment.payment_icon_menu +NEW ir.ui.view: account_payment.res_config_settings_view_form +DEL ir.ui.view: account_payment.payment_checkout_inherit +DEL ir.ui.view: account_payment.payment_manage_inherit +DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_invoice_page_inherit_payment +DEL ir.ui.view: account_payment_invoice_online_payment_patch.portal_my_invoices_payment +DEL ir.ui.view: account_payment_invoice_online_payment_patch.res_config_settings_view_form +NEW onboarding.onboarding.step: account_payment.onboarding_onboarding_step_payment_provider (noupdate) +# NOTHING TO DO From 44ebe8bbb4bc94746aa75354ec33c2ae3f3f9764 Mon Sep 17 00:00:00 2001 From: Martin Varela Date: Mon, 9 Dec 2024 14:25:10 -0300 Subject: [PATCH 5/5] [17.0][OU-ADD] account_payment: migrate to 17.0 Remove xmlid rename of enable_portal_payment. Done in apriori.py --- .../account_payment/17.0.2.0/pre-migration.py | 15 --------------- .../17.0.2.0/upgrade_analysis_work.txt | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py b/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py deleted file mode 100644 index 341a02ff1cad..000000000000 --- a/openupgrade_scripts/scripts/account_payment/17.0.2.0/pre-migration.py +++ /dev/null @@ -1,15 +0,0 @@ -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from openupgradelib import openupgrade - -_xmlid_renames = [ - ( - "account_payment_invoice_online_payment_patch.enable_portal_payment", - "account_payment.enable_portal_payment", - ), -] - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.rename_xmlids(env.cr, _xmlid_renames) diff --git a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt index 3f9c850eeaa6..e35a50acf4ad 100644 --- a/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/account_payment/17.0.2.0/upgrade_analysis_work.txt @@ -3,7 +3,7 @@ ---XML records in module 'account_payment'--- NEW ir.config_parameter: account_payment.enable_portal_payment [renamed from account_payment_invoice_online_payment_patch module] (noupdate) DEL ir.config_parameter: account_payment_invoice_online_payment_patch.enable_portal_payment [renamed to account_payment module] (noupdate) -# DONE pre-migration rename XML-IDs +# NOTHING TO DO: Done in apriori.py NEW ir.model.access: account_payment.payment_transaction_user [renamed from payment module] # NOTHING TO DO