From 8d910c59b5cef5501384cad73976384f429fcd25 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 7 Oct 2019 13:59:05 +0000 Subject: [PATCH] [FIX] stock: route_sequence in multi-company - Go to Inventory > Configuration > Warehouse Management > Routes > Make To Order - Edit - Swap two rules with the handles - Save An access error is raised. This is due to the recomputation of `route_sequence` which is performed on all companies. Setting it as `compute_sudo` solves the problem. opw-2072159 closes odoo/odoo#38104 Signed-off-by: Nicolas Martinelli (nim) --- addons/stock/models/stock_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py index d810c2655f4..4ce280e4764 100644 --- a/addons/stock/models/stock_rule.py +++ b/addons/stock/models/stock_rule.py @@ -51,7 +51,7 @@ class StockRule(models.Model): "Trigger Another Rule: the system will try to find a stock rule to bring the products in the source location. The available stock will be ignored.\n" "Take From Stock, if Unavailable, Trigger Another Rule: the products will be taken from the available stock of the source location." "If there is no stock available, the system will try to find a rule to bring the products in the source location.") - route_sequence = fields.Integer('Route Sequence', related='route_id.sequence', store=True, readonly=False) + route_sequence = fields.Integer('Route Sequence', related='route_id.sequence', store=True, readonly=False, compute_sudo=True) picking_type_id = fields.Many2one( 'stock.picking.type', 'Operation Type', required=True, check_company=True)