From e9f61cc51679c6420ba364631f03f377021ec409 Mon Sep 17 00:00:00 2001 From: James Curtis Date: Tue, 20 Aug 2019 11:32:35 +0100 Subject: [PATCH 1/2] [FIX][046] Shift allocation permissions still applied to task completion As part of the removal of shift allocation a task can now be completed by any user (not just those assigned to the ward). Disables the uid check against an activity completion. --- nh_clinical/api.py | 5 +---- nh_eobs_mobile/controllers/main.py | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nh_clinical/api.py b/nh_clinical/api.py index 4c09d0f3..51c8f1b0 100644 --- a/nh_clinical/api.py +++ b/nh_clinical/api.py @@ -350,8 +350,5 @@ def check_activity_access(self, cr, uid, activity_id, context=None): activity_ids = activity_pool.search(cr, uid, domain, context=context) if not activity_ids: return False - user_id = activity_pool.read( - cr, uid, activity_id, ['user_id'], context=context)['user_id'] - if user_id and user_id[0] != uid: - return False + return True diff --git a/nh_eobs_mobile/controllers/main.py b/nh_eobs_mobile/controllers/main.py index 4cb8ed19..45bc98de 100755 --- a/nh_eobs_mobile/controllers/main.py +++ b/nh_eobs_mobile/controllers/main.py @@ -715,6 +715,8 @@ def _find_next_ews_obs(patient_id): break except ValueError: pass + except KeyError: + pass cr, uid, context = request.cr, request.session.uid, request.context obj_nh_activity = request.registry['nh.activity'] From aa3963eb114bafc584193894f5bb7a4a46470a99 Mon Sep 17 00:00:00 2001 From: James Curtis Date: Tue, 20 Aug 2019 11:38:03 +0100 Subject: [PATCH 2/2] [FIX][046] Label on mobile form to be changed for all observations. Updates the label for the effective_date field for all observation types on the mobile form. --- nh_activity/activity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nh_activity/activity.py b/nh_activity/activity.py index 9ff46afb..ef10799e 100644 --- a/nh_activity/activity.py +++ b/nh_activity/activity.py @@ -125,7 +125,8 @@ def _get_data_type_selection(self, cr, uid, context=None): 'Termination Time', help="Completed, Aborted, Expired, Cancelled", readonly=True), 'effective_date_terminated': fields.datetime( - 'Effective Termination Time', help="Completed, Aborted, Expired, Cancelled", + 'Effective Date (ONLY CHANGE EFFECTIVE TIME IF NEEDED - Observation times can only be back-dated by 8 hours)', + help="Completed, Aborted, Expired, Cancelled", readonly=True), # dates limits 'date_deadline': fields.datetime('Deadline Time', readonly=True),