From 5f1748133df2d23c9c96257a2a5a9e5b63c8b790 Mon Sep 17 00:00:00 2001 From: RaulOForgeFlow Date: Mon, 19 Apr 2021 11:59:26 +0200 Subject: [PATCH 1/2] [14.0][MIG] uom: migration to v14 --- doc/source/modules130-140.rst | 2 +- .../scripts/uom/14.0.1.0/post-migration.py | 8 ++++++++ .../scripts/uom/14.0.1.0/upgrade_analysis_work.txt | 13 +++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/uom/14.0.1.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/uom/14.0.1.0/upgrade_analysis_work.txt diff --git a/doc/source/modules130-140.rst b/doc/source/modules130-140.rst index d45084696221..3eb51a6d7e7d 100644 --- a/doc/source/modules130-140.rst +++ b/doc/source/modules130-140.rst @@ -638,7 +638,7 @@ Module coverage 13.0 -> 14.0 +--------------------------------------------+-------------------------------------------------+ |transifex | | +--------------------------------------------+-------------------------------------------------+ -|uom | | +|uom | Done | +--------------------------------------------+-------------------------------------------------+ |utm | | +--------------------------------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/uom/14.0.1.0/post-migration.py b/openupgrade_scripts/scripts/uom/14.0.1.0/post-migration.py new file mode 100644 index 000000000000..8a215686d4a4 --- /dev/null +++ b/openupgrade_scripts/scripts/uom/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, "uom", "14.0.1.0/noupdate_changes.xml") diff --git a/openupgrade_scripts/scripts/uom/14.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/uom/14.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..d729c54336cc --- /dev/null +++ b/openupgrade_scripts/scripts/uom/14.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,13 @@ +---Models in module 'uom'--- +---Fields in module 'uom'--- +uom / uom.category / measure_type (selection) : DEL selection_keys: ['length', 'unit', 'volume', 'weight', 'working_time'] +# NOTHING TO DO: not used anymore, error when filled in v13. + +uom / uom.uom / measure_type (selection) : DEL selection_keys: function +# NOTHING TO DO: It stored the measure type from uom.category, but not needed anymore. + +---XML records in module 'uom'--- +NEW uom.uom: uom.product_uom_cubic_foot (noupdate) +NEW uom.uom: uom.product_uom_cubic_inch (noupdate) +NEW uom.uom: uom.product_uom_cubic_meter (noupdate) +# NOTHING TO DO: (noupdate="1") Adds new imperial system volume units From e0bf271f9ec09db01fef56ddda34232ebf50debd Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sun, 6 Jun 2021 14:08:59 +0200 Subject: [PATCH 2/2] [FIX] uom: Put proper default rounding in some units Deleting a field entry doesn't mean that the entry is nullified. In this case, it means the the default value is applied, so we put such value. --- openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml index 4b3ab2566fef..cdd1619b40fb 100644 --- a/openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml +++ b/openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml @@ -16,7 +16,7 @@ in - + reference @@ -39,7 +39,7 @@ qt (US) - + reference