From 2f8d2cf95019e8c4525b1c25d9efd402d97da5e4 Mon Sep 17 00:00:00 2001 From: Flectra Community Bot Date: Sun, 10 Oct 2021 02:10:21 +0000 Subject: [PATCH] Automatic Update form OCA2FC Migrator --- .../migrations/14.0.1.0.0/pre-migration.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/account_tax_balance/migrations/14.0.1.0.0/pre-migration.py b/account_tax_balance/migrations/14.0.1.0.0/pre-migration.py index ec74d7f..daddabc 100644 --- a/account_tax_balance/migrations/14.0.1.0.0/pre-migration.py +++ b/account_tax_balance/migrations/14.0.1.0.0/pre-migration.py @@ -16,16 +16,22 @@ def migrate(env, version): """ old_move_type_column = "move_type" new_move_type_column = "financial_type" + move_model_name = "account.move" move_table_name = "account_move" enterprise_move_type_rename = "move_type_custom" ou_move_type_rename = openupgrade.get_legacy_name(old_move_type_column) for move_type_rename in (enterprise_move_type_rename, ou_move_type_rename): if openupgrade.column_exists(env.cr, move_table_name, move_type_rename): - openupgrade.rename_columns( - env.cr, - { - move_table_name: [(move_type_rename, new_move_type_column)], - }, + openupgrade.rename_fields( + env, + [ + ( + move_model_name, + move_table_name, + move_type_rename, + new_move_type_column, + ), + ], ) break