Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen committed Jun 15, 2020
1 parent ac8b9bd commit f5d93ca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stock_dynamic_routing/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2019 Camptocamp (https://www.camptocamp.com)
{
"name": "Stock Dynamic Routing",
"summary": "Dynamic routing for special locations",
"summary": "Dynamic routing of stock moves",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"website": "https://github.com/OCA/wms",
"category": "Warehouse Management",
"version": "13.0.1.0.0",
"license": "AGPL-3",
Expand Down
7 changes: 7 additions & 0 deletions stock_dynamic_routing/models/stock_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ def __cached_is_rule_valid_for_move(self, rule, move):
The method _routing_rule_for_move(_line)s reset the cache at beginning.
Cache the result so inside _routing_rule_for_move(_line)s, we compute it
only once for a move and a rule (if we have several move lines).
This method is part of the internal machinery of the algorithm to
find rules. It exists so we can have a local cache during the time of a
transaction, and is not meant to be overriden in any way.
If you wish to customize the validity of a rule, you should extend
``StockRoutingRule._is_valid_for_moves()``
"""
return rule._is_valid_for_moves(move)

Expand Down
1 change: 1 addition & 0 deletions stock_dynamic_routing/tests/test_routing_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TestRoutingPullCommon(common.SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.partner_delta = cls.env.ref("base.res_partner_4")
cls.wh = cls.env["stock.warehouse"].create(
{
Expand Down
1 change: 1 addition & 0 deletions stock_dynamic_routing/tests/test_routing_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TestRoutingPush(common.SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.partner_delta = cls.env.ref("base.res_partner_4")
cls.wh = cls.env["stock.warehouse"].create(
{
Expand Down
1 change: 1 addition & 0 deletions stock_dynamic_routing/tests/test_routing_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TestRoutingRule(common.SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.product = cls.env["product.product"].create(
{"name": "Product", "type": "product"}
)
Expand Down

0 comments on commit f5d93ca

Please sign in to comment.