From e32155ecb47179b2e352383a0f61c5b9fb935c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Thu, 9 Mar 2023 16:28:33 +0100 Subject: [PATCH] [OU-FIX] account_payment_order: refactor migration script --- .../migrations/14.0.2.0.0/post-migration.py | 3 +++ .../migrations/14.0.2.0.0/pre-migration.py | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 account_payment_order/migrations/14.0.2.0.0/pre-migration.py diff --git a/account_payment_order/migrations/14.0.2.0.0/post-migration.py b/account_payment_order/migrations/14.0.2.0.0/post-migration.py index 14d9b2c34..33630a5ac 100644 --- a/account_payment_order/migrations/14.0.2.0.0/post-migration.py +++ b/account_payment_order/migrations/14.0.2.0.0/post-migration.py @@ -173,3 +173,6 @@ def migrate(env, version): ) _delete_hooks(env) _insert_payment_line_payment_link(env) + openupgrade.delete_records_safely_by_xml_id( + env, ["account_payment_order.bank_payment_line_company_rule"] + ) diff --git a/account_payment_order/migrations/14.0.2.0.0/pre-migration.py b/account_payment_order/migrations/14.0.2.0.0/pre-migration.py new file mode 100644 index 000000000..ec25c07e9 --- /dev/null +++ b/account_payment_order/migrations/14.0.2.0.0/pre-migration.py @@ -0,0 +1,8 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.remove_tables_fks(env.cr, ["bank_payment_line"])