[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user