From c71a1ff4a515a8d280f68e4bd13dc12f3fb7a5c5 Mon Sep 17 00:00:00 2001 From: Maik Steinfeld Date: Mon, 10 Oct 2022 15:15:46 +0200 Subject: [PATCH] [MIG] stock_mts_mto_rule: Migration to 16.0 --- stock_mts_mto_rule/__manifest__.py | 2 +- stock_mts_mto_rule/data/stock_data.xml | 2 +- stock_mts_mto_rule/models/stock_warehouse.py | 4 ++-- stock_mts_mto_rule/tests/test_mto_mts_route.py | 6 +++--- stock_mts_mto_rule/view/pull_rule.xml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 65b4eb83f..d8b380172 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": "15.0.1.0.1", + "version": "16.0.1.0.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 28fb7eac3..1ac7b629c 100644 --- a/stock_mts_mto_rule/data/stock_data.xml +++ b/stock_mts_mto_rule/data/stock_data.xml @@ -3,7 +3,7 @@ - + Make To Order + Make To Stock 5 diff --git a/stock_mts_mto_rule/models/stock_warehouse.py b/stock_mts_mto_rule/models/stock_warehouse.py index c63675fab..0743315f8 100644 --- a/stock_mts_mto_rule/models/stock_warehouse.py +++ b/stock_mts_mto_rule/models/stock_warehouse.py @@ -65,7 +65,7 @@ class StockWarehouse(models.Model): "name": self._format_rulename( location_id, location_dest_id, "MTS+MTO" ), - "location_id": location_dest_id.id, + "location_dest_id": location_dest_id.id, "location_src_id": location_id.id, "picking_type_id": picking_type_id.id, }, @@ -88,7 +88,7 @@ class StockWarehouse(models.Model): # _get_global_route_rules_values rule = self.env["stock.rule"].search( [ - ("location_id", "=", self.mts_mto_rule_id.location_id.id), + ("location_dest_id", "=", self.mts_mto_rule_id.location_dest_id.id), ("location_src_id", "=", self.mts_mto_rule_id.location_src_id.id), ("route_id", "=", self.delivery_route_id.id), ], diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index e4370952a..82c737457 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -186,7 +186,7 @@ class TestMtoMtsRoute(TransactionCase): mts_mto_route = self.warehouse.mts_mto_rule_id self.assertEqual(mts_mto_route.warehouse_id, self.warehouse) self.assertEqual( - mts_mto_route.location_id, self.warehouse.mto_pull_id.location_id + mts_mto_route.location_dest_id, self.warehouse.mto_pull_id.location_dest_id ) self.assertEqual( mts_mto_route.picking_type_id, self.warehouse.mto_pull_id.picking_type_id @@ -233,9 +233,9 @@ class TestMtoMtsRoute(TransactionCase): "warehouse_selectable": True, "name": "dummy route", } - self.dummy_route = self.env["stock.location.route"].create(route_vals) + self.dummy_route = self.env["stock.route"].create(route_vals) rule_vals = { - "location_id": self.env.ref("stock.stock_location_stock").id, + "location_dest_id": self.env.ref("stock.stock_location_stock").id, "location_src_id": self.env.ref("stock.stock_location_suppliers").id, "action": "pull", "warehouse_id": self.warehouse.id, diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index 3117d7ba7..4710648fa 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -1,8 +1,8 @@ - stock.location.route.form.mts.mto - stock.location.route + stock.route.form.mts.mto + stock.route