From 8ed8b46f6434a2a3adea69e0134317e30bf9b936 Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Fri, 27 Jul 2018 09:43:11 +0200 Subject: [PATCH] [FIX] stock: corssdock rules not update It happens when the route is already set on the warehouse. In this the system will only active the route however the rules inside this route still inactive. This commit set active the rules in both case when the route is created or set as active. --- addons/stock/models/stock_warehouse.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py index e02b5bc06ca..f1775cd160f 100644 --- a/addons/stock/models/stock_warehouse.py +++ b/addons/stock/models/stock_warehouse.py @@ -337,12 +337,12 @@ class Warehouse(models.Model): else: crossdock_route = self.env['stock.location.route'].create(warehouse._get_crossdock_route_values()) # note: fixed cross-dock is logically mto - routings = routes_data[warehouse.id]['crossdock'] - pull_list = warehouse._get_rule_values( - routings, - values={'procure_method': 'make_to_order', 'active': warehouse.delivery_steps != 'ship_only' and warehouse.reception_steps != 'one_step', 'route_id': crossdock_route.id}) - for rule_vals in pull_list: - self.env['stock.rule'].create(rule_vals) + routings = routes_data[warehouse.id]['crossdock'] + pull_list = warehouse._get_rule_values( + routings, + values={'procure_method': 'make_to_order', 'active': warehouse.delivery_steps != 'ship_only' and warehouse.reception_steps != 'one_step', 'route_id': crossdock_route.id}) + for rule_vals in pull_list: + self.env['stock.rule'].create(rule_vals) return crossdock_route def create_resupply_routes(self, supplier_warehouses):