From b06f97603ea847b9602a4b6789d05a245149f767 Mon Sep 17 00:00:00 2001 From: mreficent Date: Mon, 19 Jul 2021 17:15:25 +0200 Subject: [PATCH] [OU-ADD] sale_management: Migration scripts --- docsource/modules130-140.rst | 2 +- .../14.0.1.0/noupdate_changes.xml | 4 ++-- .../sale_management/14.0.1.0/post-migration.py | 8 ++++++++ .../sale_management/14.0.1.0/pre-migration.py | 10 ++++++++++ .../14.0.1.0/upgrade_analysis_work.txt | 18 ++++++++++++++++++ 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 openupgrade_scripts/scripts/sale_management/14.0.1.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/sale_management/14.0.1.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/sale_management/14.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules130-140.rst b/docsource/modules130-140.rst index f74063f64087..e3db0573d161 100644 --- a/docsource/modules130-140.rst +++ b/docsource/modules130-140.rst @@ -594,7 +594,7 @@ Module coverage 13.0 -> 14.0 +--------------------------------------------+-------------------------------------------------+ |sale_expense | | +--------------------------------------------+-------------------------------------------------+ -|sale_management | | +|sale_management | Done | +--------------------------------------------+-------------------------------------------------+ |sale_margin | | +--------------------------------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml index 54b20400853d..428fa47ce72e 100644 --- a/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml +++ b/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml @@ -1,6 +1,6 @@ - + diff --git a/openupgrade_scripts/scripts/sale_management/14.0.1.0/post-migration.py b/openupgrade_scripts/scripts/sale_management/14.0.1.0/post-migration.py new file mode 100644 index 000000000000..792fe1309940 --- /dev/null +++ b/openupgrade_scripts/scripts/sale_management/14.0.1.0/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, "sale_management", "14.0.1.0/noupdate_changes.xml") diff --git a/openupgrade_scripts/scripts/sale_management/14.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/sale_management/14.0.1.0/pre-migration.py new file mode 100644 index 000000000000..a06b9e3dfeab --- /dev/null +++ b/openupgrade_scripts/scripts/sale_management/14.0.1.0/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, "sale_management", ["sale_order_template_rule_company"], True + ) diff --git a/openupgrade_scripts/scripts/sale_management/14.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/sale_management/14.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..55638abac139 --- /dev/null +++ b/openupgrade_scripts/scripts/sale_management/14.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,18 @@ +---Models in module 'sale_management'--- +---Fields in module 'sale_management'--- +sale_management / res.company / sale_order_template_id (many2one): NEW relation: sale.order.template +# NOTHING TO DO: new feature + +sale_management / sale.order.template.line / discount (float) : DEL +sale_management / sale.order.template.line / price_unit (float) : DEL required +sale_management / sale.order.template.option / discount (float) : DEL +sale_management / sale.order.template.option / price_unit (float) : DEL required +# NOTHING TO DO: obsolete + +---XML records in module 'sale_management'--- +NEW digest.tip: sale_management.digest_tip_sale1_management_0 (noupdate) +NEW digest.tip: sale_management.digest_tip_sale_management_1 (noupdate) +# NOTHING TO DO + +ir.rule: sale_management.sale_order_template_rule_company (noupdate) (noupdate switched) +# DONE: pre-migration: switched noupdate