From 5a760d0659cfba0c4d85952db92568c50d884316 Mon Sep 17 00:00:00 2001 From: mreficent Date: Thu, 25 Jul 2019 17:06:34 +0200 Subject: [PATCH] [ADD] Migrations scripts --- .../migrations/12.0.1.0.0/pre-migration.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 partner_statement/migrations/12.0.1.0.0/pre-migration.py diff --git a/partner_statement/migrations/12.0.1.0.0/pre-migration.py b/partner_statement/migrations/12.0.1.0.0/pre-migration.py new file mode 100644 index 00000000..83d767db --- /dev/null +++ b/partner_statement/migrations/12.0.1.0.0/pre-migration.py @@ -0,0 +1,29 @@ +# Copyright 2019 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def rename_wizards(cr): + if openupgrade.table_exists(cr, 'customer_activity_statement_wizard'): + openupgrade.rename_tables(cr, [( + 'customer_activity_statement_wizard', + 'activity_statement_wizard'), + ]) + openupgrade.rename_models(cr, [( + 'customer.activity.statement.wizard', + 'activity.statement.wizard'), + ]) + if openupgrade.table_exists(cr, 'customer_outstanding_statement_wizard'): + openupgrade.rename_tables(cr, [( + 'customer_outstanding_statement_wizard', + 'outstanding_statement_wizard'), + ]) + openupgrade.rename_models(cr, [( + 'customer.outstanding.statement.wizard', + 'outstanding.statement.wizard'), + ]) + + +@openupgrade.migrate() +def migrate(env, version): + rename_wizards(env.cr)