Stock Warehouse Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else [('id', 'in', user.allowed_warehouse_ids.ids)] if user.allowed_warehouse_ids else [(1, '=', 1)] ) Stock Picking Type Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else ['|', ('id', 'in', user.allowed_picking_type_ids.ids), ('warehouse_id', 'in', user.allowed_warehouse_ids.ids + user.sudo().allowed_location_ids.warehouse_id.ids)] if (user.allowed_picking_type_ids or user.allowed_warehouse_ids or user.allowed_location_ids) else [(1, '=', 1)] ) Stock Location Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else ['|', '|', '|', ('id', 'in', user.allowed_location_ids.ids), ('id', 'child_of', user.allowed_location_ids.ids), ('id', 'parent_of', user.allowed_location_ids.ids), ('warehouse_id', 'in', user.allowed_warehouse_ids.ids + user.sudo().allowed_location_ids.warehouse_id.ids)] if (user.allowed_location_ids or user.allowed_warehouse_ids) else [(1, '=', 1)] ) Stock Quant Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else ['|', ('location_id', 'in', user.allowed_location_ids.ids), ('location_id', 'child_of', user.allowed_location_ids.ids)] if user.allowed_location_ids else [(1, '=', 1)] ) Stock Move Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else ['|', '|', ('location_id', 'in', user.allowed_location_ids.ids), ('location_id', 'child_of', user.allowed_location_ids.ids), '|', ('location_dest_id', 'in', user.allowed_location_ids.ids), ('location_dest_id', 'child_of', user.allowed_location_ids.ids)] if user.allowed_location_ids else [(1, '=', 1)] ) Stock Move Line Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else ['|', '|', ('location_id', 'in', user.allowed_location_ids.ids), ('location_id', 'child_of', user.allowed_location_ids.ids), '|', ('location_dest_id', 'in', user.allowed_location_ids.ids), ('location_dest_id', 'child_of', user.allowed_location_ids.ids)] if user.allowed_location_ids else [(1, '=', 1)] ) MRP Workcenter Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else [('id', 'in', user.allowed_workcenter_ids.ids)] if user.allowed_workcenter_ids else [(1, '=', 1)] ) Approval Category Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else [('id', 'in', user.allowed_approval_category_ids.ids)] if user.allowed_approval_category_ids else [(1, '=', 1)] ) Report Stock Quantity Allowed Access ( [(1, '=', 1)] if user.env.context.get('bypass_user_restriction') or user.has_group('base.group_system') else [('warehouse_id', 'in', user.allowed_warehouse_ids.ids + user.sudo().allowed_location_ids.warehouse_id.ids)] if (user.allowed_warehouse_ids or user.allowed_location_ids) else [(1, '=', 1)] )