diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index bb1221d16..881a074e4 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -2,7 +2,7 @@ Stock MTS+MTO Rule ================== -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! @@ -104,6 +104,7 @@ Contributors - Florian da Costa - Jared Kipe - Alan Ramos +- Aleksander Milinkevich Maintainers ----------- diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index d8b380172..eed5904c2 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": "16.0.1.0.0", + "version": "17.0.1.0.0", "development_status": "Mature", "category": "Warehouse", "website": "https://github.com/OCA/stock-logistics-warehouse", diff --git a/stock_mts_mto_rule/models/stock_warehouse.py b/stock_mts_mto_rule/models/stock_warehouse.py index 0743315f8..718af2a41 100644 --- a/stock_mts_mto_rule/models/stock_warehouse.py +++ b/stock_mts_mto_rule/models/stock_warehouse.py @@ -15,12 +15,12 @@ class StockWarehouse(models.Model): mts_mto_rule_id = fields.Many2one("stock.rule", "MTO+MTS rule", check_company=True) def _get_all_routes(self): - routes = super(StockWarehouse, self)._get_all_routes() + routes = super()._get_all_routes() routes |= self.mapped("mts_mto_rule_id.route_id") return routes def _update_name_and_code(self, new_name=False, new_code=False): - res = super(StockWarehouse, self)._update_name_and_code(new_name, new_code) + res = super()._update_name_and_code(new_name, new_code) if not new_name: return res for warehouse in self.filtered("mts_mto_rule_id"): @@ -36,7 +36,7 @@ class StockWarehouse(models.Model): def _get_route_name(self, route_type): if route_type == "mts_mto": return _("MTS+MTO") - return super(StockWarehouse, self)._get_route_name(route_type) + return super()._get_route_name(route_type) def _get_global_route_rules_values(self): rule = self.get_rules_dict()[self.id][self.delivery_steps] @@ -44,7 +44,7 @@ class StockWarehouse(models.Model): location_id = rule.from_loc location_dest_id = rule.dest_loc picking_type_id = rule.picking_type - res = super(StockWarehouse, self)._get_global_route_rules_values() + res = super()._get_global_route_rules_values() res.update( { "mts_mto_rule_id": { @@ -75,7 +75,7 @@ class StockWarehouse(models.Model): return res def _create_or_update_global_routes_rules(self): - res = super(StockWarehouse, self)._create_or_update_global_routes_rules() + res = super()._create_or_update_global_routes_rules() if ( self.mto_mts_management diff --git a/stock_mts_mto_rule/readme/CONTRIBUTORS.md b/stock_mts_mto_rule/readme/CONTRIBUTORS.md index 5a43bbb04..35dafae41 100644 --- a/stock_mts_mto_rule/readme/CONTRIBUTORS.md +++ b/stock_mts_mto_rule/readme/CONTRIBUTORS.md @@ -1,3 +1,4 @@ - Florian da Costa \<\> - Jared Kipe \<\> - Alan Ramos \<\> +- Aleksander Milinkevich \<\> diff --git a/stock_mts_mto_rule/static/description/index.html b/stock_mts_mto_rule/static/description/index.html index 6145600e2..26ac2a1c4 100644 --- a/stock_mts_mto_rule/static/description/index.html +++ b/stock_mts_mto_rule/static/description/index.html @@ -458,6 +458,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Florian da Costa <florian.dacosta@akretion.com>
  • Jared Kipe <jared@hibou.io>
  • Alan Ramos <alan.ramos@jarsa.com.mx>
  • +
  • Aleksander Milinkevich <aleksander@versada.eu>
  • 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 82c737457..20cb58356 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -1,6 +1,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import exceptions +from odoo import Command, exceptions from odoo.tests.common import TransactionCase @@ -18,7 +18,7 @@ class TestMtoMtsRoute(TransactionCase): def test_standard_mto_route(self): mto_route = self.env.ref("stock.route_warehouse0_mto") mto_route.active = True - self.product.route_ids = [(6, 0, [mto_route.id])] + self.product.route_ids = [Command.set(mto_route.ids)] self.env["procurement.group"].run( [ self.group.Procurement( @@ -56,7 +56,7 @@ class TestMtoMtsRoute(TransactionCase): def test_mts_mto_route_split(self): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") - self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.product.route_ids = [Command.set(mto_mts_route.ids)] self._create_quant(1.0) self.env["procurement.group"].run( [ @@ -96,7 +96,7 @@ class TestMtoMtsRoute(TransactionCase): def test_mts_mto_route_mto_only(self): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") - self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.product.route_ids = [Command.set(mto_mts_route.ids)] self.env["procurement.group"].run( [ self.group.Procurement( @@ -123,7 +123,7 @@ class TestMtoMtsRoute(TransactionCase): def test_mts_mto_route_mts_only(self): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") - self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.product.route_ids = [Command.set(mto_mts_route.ids)] self._create_quant(3.0) self.env["procurement.group"].run( [ @@ -214,7 +214,7 @@ class TestMtoMtsRoute(TransactionCase): self.assertEqual(new_rule_name, self.warehouse.mts_mto_rule_id.name) def setUp(self): - super(TestMtoMtsRoute, self).setUp() + super().setUp() self.move_obj = self.env["stock.move"] self.warehouse = self.env.ref("stock.warehouse0") self.uom = self.env["uom.uom"].browse(1) @@ -244,4 +244,4 @@ class TestMtoMtsRoute(TransactionCase): "route_id": self.dummy_route.id, } self.dummy_rule = self.env["stock.rule"].create(rule_vals) - self.warehouse.write({"route_ids": [(4, self.dummy_route.id)]}) + self.warehouse.write({"route_ids": [Command.link(self.dummy_route.id)]}) diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index 4710648fa..d83efed57 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -9,12 +9,12 @@ @@ -28,12 +28,12 @@