diff --git a/nh_eobs/api.py b/nh_eobs/api.py index 1b1e3696..b4bc9824 100644 --- a/nh_eobs/api.py +++ b/nh_eobs/api.py @@ -637,7 +637,7 @@ def get_all_patients(self, cr, uid, ids, context=None): # The list of all patients needs to be filtered by locations (Wards) that the current user is assigned to obj_res_users = self.pool['res.users'] user_record = obj_res_users.browse(cr, uid, uid, context=context) - user_locations = [x.name for x in user_record.location_ids] + user_locations = [x.parent_id.name for x in user_record.location_ids] filtered_patient_list = [x for x in patient_list if x['parent_location'] in user_locations] return filtered_patient_list