From 38cfb71469514ee1056ae1e1cae103ba8278f566 Mon Sep 17 00:00:00 2001 From: mreficent Date: Mon, 19 Jul 2021 14:56:09 +0200 Subject: [PATCH] [OU-ADD] stock_account: Migration scripts --- docsource/modules130-140.rst | 2 +- .../14.0.1.1/noupdate_changes.xml | 4 ++-- .../stock_account/14.0.1.1/post-migration.py | 8 +++++++ .../stock_account/14.0.1.1/pre-migration.py | 10 ++++++++ .../14.0.1.1/upgrade_analysis_work.txt | 23 +++++++++++++++++++ 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 openupgrade_scripts/scripts/stock_account/14.0.1.1/post-migration.py create mode 100644 openupgrade_scripts/scripts/stock_account/14.0.1.1/pre-migration.py create mode 100644 openupgrade_scripts/scripts/stock_account/14.0.1.1/upgrade_analysis_work.txt diff --git a/docsource/modules130-140.rst b/docsource/modules130-140.rst index 4aec1e44e4b3..f94d7ecd42a9 100644 --- a/docsource/modules130-140.rst +++ b/docsource/modules130-140.rst @@ -638,7 +638,7 @@ Module coverage 13.0 -> 14.0 +--------------------------------------------+-------------------------------------------------+ |stock | Done | +--------------------------------------------+-------------------------------------------------+ -|stock_account | | +|stock_account | Done | +--------------------------------------------+-------------------------------------------------+ |stock_dropshipping | Nothing to do | +--------------------------------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/stock_account/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/stock_account/14.0.1.1/noupdate_changes.xml index 8489e4de551d..bbe69d7d5e24 100644 --- a/openupgrade_scripts/scripts/stock_account/14.0.1.1/noupdate_changes.xml +++ b/openupgrade_scripts/scripts/stock_account/14.0.1.1/noupdate_changes.xml @@ -1,6 +1,6 @@ - + diff --git a/openupgrade_scripts/scripts/stock_account/14.0.1.1/post-migration.py b/openupgrade_scripts/scripts/stock_account/14.0.1.1/post-migration.py new file mode 100644 index 000000000000..7f39345c4a3d --- /dev/null +++ b/openupgrade_scripts/scripts/stock_account/14.0.1.1/post-migration.py @@ -0,0 +1,8 @@ +# Copyright 2021 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env.cr, "stock_account", "14.0.1.1/noupdate_changes.xml") diff --git a/openupgrade_scripts/scripts/stock_account/14.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/stock_account/14.0.1.1/pre-migration.py new file mode 100644 index 000000000000..3034c706112f --- /dev/null +++ b/openupgrade_scripts/scripts/stock_account/14.0.1.1/pre-migration.py @@ -0,0 +1,10 @@ +# Copyright 2021 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.set_xml_ids_noupdate_value( + env, "stock_account", ["stock_valuation_layer_company_rule"], True + ) diff --git a/openupgrade_scripts/scripts/stock_account/14.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/stock_account/14.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..bd53d7606404 --- /dev/null +++ b/openupgrade_scripts/scripts/stock_account/14.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,23 @@ +---Models in module 'stock_account'--- +obsolete model stock.change.standard.price [transient] +new model stock.valuation.layer.revaluation [transient] +---Fields in module 'stock_account'--- +---XML records in module 'stock_account'--- +DEL ir.actions.act_window: stock_account.action_stock_inventory_valuation +DEL ir.actions.act_window: stock_account.action_view_change_standard_price +NEW ir.model.access: stock_account.access_account_journal_stock_manager +NEW ir.model.access: stock_account.access_stock_move_invoicing_payments_readonly +NEW ir.model.access: stock_account.access_stock_picking_invoicing_payments_readonly +NEW ir.model.access: stock_account.access_stock_valuation_layer_revaluation +DEL ir.model.access: stock_account.access_account_tag_stock_user +NEW ir.ui.view: stock_account.stock_account_report_product_product_replenishment +NEW ir.ui.view: stock_account.stock_valuation_layer_revaluation_form_view +DEL ir.ui.view: stock_account.product_product_normal_form_view_inherit +DEL ir.ui.view: stock_account.product_variant_easy_edit_view_inherit +DEL ir.ui.view: stock_account.stock_valuation_layer_search +DEL ir.ui.view: stock_account.view_change_standard_price +DEL ir.ui.view: stock_account.view_template_property_form +# NOTHING TO DO + +ir.rule: stock_account.stock_valuation_layer_company_rule (noupdate) (noupdate switched) +# DONE: pre-migration: switched noupdate