From cbee332bb129bf7e47ef5fbbf5ee898d963b57cd Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 8 Sep 2017 13:14:36 +0200 Subject: [PATCH] [FIX] mrp_repair: default location in multi-company 1. Create a new company 2. Create a user with access to this company and with access to repair 3. Connect as the new user 4. Try to create a new repair and the stock.warehouse access error should appear opw-769160 --- addons/mrp_repair/models/mrp_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/models/mrp_repair.py b/addons/mrp_repair/models/mrp_repair.py index 7419acb83b7..0d0044ce3f2 100644 --- a/addons/mrp_repair/models/mrp_repair.py +++ b/addons/mrp_repair/models/mrp_repair.py @@ -15,7 +15,7 @@ class Repair(models.Model): @api.model def _default_stock_location(self): - warehouse = self.env.ref('stock.warehouse0', raise_if_not_found=False) + warehouse = self.env['stock.warehouse'].search([], limit=1) if warehouse: return warehouse.lot_stock_id.id return False