From 3b0cc4861a579b4f33a7558be78e33fefcb8a28d Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Mon, 26 Aug 2019 09:59:13 +0000 Subject: [PATCH] [FIX] sale_stock: uses line route or category route Commit 2408bef fixed the way a sale order line is considered as mto or not but did not took the line route or product category route into account. closes odoo/odoo#36064 Signed-off-by: Simon Lejeune (sle) --- addons/sale_stock/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 083bf9f4551..6ad9c68c53f 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -286,7 +286,7 @@ class SaleOrderLine(models.Model): # if route MTO not found in ir_model_data, we treat the product as in MTS pass - if mto_route and mto_route in product.route_ids: + if mto_route and mto_route in product_routes: line.is_mto = True else: line.is_mto = False