[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
This commit is contained in:
Nicolas Martinelli
2017-09-08 13:14:36 +02:00
parent 825c7c1ed6
commit cbee332bb1
+1 -1
View File
@@ -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