From 354c661157ab1728b186e0892f72fb1313fabdf8 Mon Sep 17 00:00:00 2001 From: mreficent Date: Fri, 10 Nov 2017 13:25:37 +0100 Subject: [PATCH] [ADD] Migration scripts for mass_editing --- .../9.0.1.0.0/openupgrade_analysis.txt | 8 ++++++++ .../9.0.1.0.0/openupgrade_analysis_work.txt | 14 ++++++++++++++ .../migrations/9.0.1.0.0/pre-migration.py | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 mass_editing/migrations/9.0.1.0.0/openupgrade_analysis.txt create mode 100644 mass_editing/migrations/9.0.1.0.0/openupgrade_analysis_work.txt create mode 100644 mass_editing/migrations/9.0.1.0.0/pre-migration.py diff --git a/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis.txt b/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis.txt new file mode 100644 index 000000000..9422ecca3 --- /dev/null +++ b/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis.txt @@ -0,0 +1,8 @@ +---Fields in module 'mass_editing'--- +mass_editing / mass.object / model_ids (many2many) : DEL relation: ir.model +mass_editing / mass.object / model_list (char) : NEW +mass_editing / mass.object / ref_ir_act_window (many2one) : DEL relation: ir.actions.act_window +mass_editing / mass.object / ref_ir_act_window_id (many2one): NEW relation: ir.actions.act_window +mass_editing / mass.object / ref_ir_value (many2one) : DEL relation: ir.values +mass_editing / mass.object / ref_ir_value_id (many2one) : NEW relation: ir.values +---XML records in module 'mass_editing'--- diff --git a/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis_work.txt b/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis_work.txt new file mode 100644 index 000000000..752bd3304 --- /dev/null +++ b/mass_editing/migrations/9.0.1.0.0/openupgrade_analysis_work.txt @@ -0,0 +1,14 @@ +---Fields in module 'mass_editing'--- +mass_editing / mass.object / model_ids (many2many) : DEL relation: ir.model +mass_editing / mass.object / model_list (char) : NEW +# NOTHING TO DO + +mass_editing / mass.object / ref_ir_act_window (many2one) : DEL relation: ir.actions.act_window +mass_editing / mass.object / ref_ir_act_window_id (many2one): NEW relation: ir.actions.act_window +# Done: pre-migration: Renamed fields. + +mass_editing / mass.object / ref_ir_value (many2one) : DEL relation: ir.values +mass_editing / mass.object / ref_ir_value_id (many2one) : NEW relation: ir.values +# Done: pre-migration: Renamed fields. + +---XML records in module 'mass_editing'--- diff --git a/mass_editing/migrations/9.0.1.0.0/pre-migration.py b/mass_editing/migrations/9.0.1.0.0/pre-migration.py new file mode 100644 index 000000000..d14102102 --- /dev/null +++ b/mass_editing/migrations/9.0.1.0.0/pre-migration.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +_field_renames = [ + ('mass.object', 'mass_object', 'ref_ir_act_window', + 'ref_ir_act_window_id'), + ('mass.object', 'mass_object', 'ref_ir_value', 'ref_ir_value_id'), +] + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + openupgrade.rename_fields(env, _field_renames)