Skip to content

Commit

Permalink
[MIG] stock_mts_mto_rule: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
msteinfeld-sirum committed Oct 11, 2022
1 parent b1447ba commit 3d4ec13
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions setup/stock_mts_mto_rule/odoo/addons/stock_mts_mto_rule
6 changes: 6 additions & 0 deletions setup/stock_mts_mto_rule/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
2 changes: 1 addition & 1 deletion stock_mts_mto_rule/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion stock_mts_mto_rule/data/stock_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
Procurement rules
-->
<record id="route_mto_mts" model='stock.location.route'>
<record id="route_mto_mts" model='stock.route'>
<field name="name">Make To Order + Make To Stock</field>
<field name="sequence">5</field>
<field name="product_selectable" eval="True" />
Expand Down
4 changes: 2 additions & 2 deletions stock_mts_mto_rule/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _get_global_route_rules_values(self):
"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,
},
Expand All @@ -88,7 +88,7 @@ def _create_or_update_global_routes_rules(self):
# _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),
],
Expand Down
6 changes: 3 additions & 3 deletions stock_mts_mto_rule/tests/test_mto_mts_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_create_routes(self):
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
Expand Down Expand Up @@ -233,9 +233,9 @@ def setUp(self):
"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,
Expand Down
4 changes: 2 additions & 2 deletions stock_mts_mto_rule/view/pull_rule.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="stock_location_route_form_view_mto_mto" model="ir.ui.view">
<field name="name">stock.location.route.form.mts.mto</field>
<field name="model">stock.location.route</field>
<field name="name">stock.route.form.mts.mto</field>
<field name="model">stock.route</field>
<field name="inherit_id" ref="stock.stock_location_route_form_view" />
<field name="arch" type="xml">
<field name="action" position="after">
Expand Down

0 comments on commit 3d4ec13

Please sign in to comment.