From 1fb91ae3a0962aadd151479e556f8be95441469e Mon Sep 17 00:00:00 2001 From: david Date: Thu, 2 Sep 2021 08:42:11 +0200 Subject: [PATCH] [FIX] stock_mts_mto_rule: don't update route Odoo declares routes as noupdate records so the user has the control over them. Another side effect of updatable route records is on initializing the record when OpenUpgrade is used to upgrade, which in a multicompany environment with mixed companies in the products could lead to a false company restriction error (maybe due to a bad declaration of restrictions in the product_ids field). TT31601 --- stock_mts_mto_rule/__manifest__.py | 2 +- stock_mts_mto_rule/data/stock_data.xml | 2 +- .../migrations/13.0.1.3.0/pre-migration.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 stock_mts_mto_rule/migrations/13.0.1.3.0/pre-migration.py diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index fa84bc75f..bd5829c9e 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Stock MTS+MTO Rule", "summary": "Add a MTS+MTO route", - "version": "13.0.1.2.0", + "version": "13.0.1.3.0", "development_status": "Mature", "category": "Warehouse", "website": "https://github.com/OCA/stock-logistics-warehouse", diff --git a/stock_mts_mto_rule/data/stock_data.xml b/stock_mts_mto_rule/data/stock_data.xml index 3028cfee4..f48e5c8e0 100644 --- a/stock_mts_mto_rule/data/stock_data.xml +++ b/stock_mts_mto_rule/data/stock_data.xml @@ -1,5 +1,5 @@ - + diff --git a/stock_mts_mto_rule/migrations/13.0.1.3.0/pre-migration.py b/stock_mts_mto_rule/migrations/13.0.1.3.0/pre-migration.py new file mode 100644 index 000000000..d54ba9193 --- /dev/null +++ b/stock_mts_mto_rule/migrations/13.0.1.3.0/pre-migration.py @@ -0,0 +1,11 @@ +# Copyright 2021 Tecnativa David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # Now the record is declared as noupdate + openupgrade.set_xml_ids_noupdate_value( + env, "stock_mts_mto_rule", ["route_mto_mts"], True, + )