|
@ -30,9 +30,11 @@ class StockPicking(models.Model): |
|
|
@api.onchange('location_id', 'location_dest_id') |
|
|
@api.onchange('location_id', 'location_dest_id') |
|
|
def _onchange_location_id(self): |
|
|
def _onchange_location_id(self): |
|
|
"""Domain for location_id and location_dest_id.""" |
|
|
"""Domain for location_id and location_dest_id.""" |
|
|
return { |
|
|
if self.env['ir.config_parameter'].sudo().get_param('user_warehouse_restriction.group_user_warehouse_restriction'): |
|
|
|
|
|
return { |
|
|
'domain': {'location_id': [ |
|
|
'domain': {'location_id': [ |
|
|
('warehouse_id.user_ids', 'in', self.env.user.id)], |
|
|
('warehouse_id.user_ids', 'in', self.env.user.id)], |
|
|
'location_dest_id': [ |
|
|
'location_dest_id': [ |
|
|
('warehouse_id.user_ids', 'in', self.env.user.id)]}} |
|
|
('warehouse_id.user_ids', 'in', self.env.user.id)]}} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|