From d5d0c0651d90964f49988199c5be4f81011b1cd5 Mon Sep 17 00:00:00 2001 From: younes Date: Tue, 24 Jun 2025 15:07:30 +0100 Subject: [PATCH] Display the shifts in the application based on the employee --- .../odex_mobile/controllers/rest_api_v2/authentication.py | 1 + odex25_mobile/odex_mobile/models/res_users.py | 1 + 2 files changed, 2 insertions(+) diff --git a/odex25_mobile/odex_mobile/controllers/rest_api_v2/authentication.py b/odex25_mobile/odex_mobile/controllers/rest_api_v2/authentication.py index 7ab82ce07..4abf6854c 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/authentication.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/authentication.py @@ -251,6 +251,7 @@ class AuthenticationController(http.Controller): dic['token'] = token dic['is_approve'] = 'group_division_manager' in dic.get('groups',[]) + dic['has_two_periods'] = not employee.resource_calendar_id.is_full_day if employee.resource_calendar_id else False http_helper.cleanup() end_time_pc = time.perf_counter() execution_time_pc = end_time_pc - start_time_pc diff --git a/odex25_mobile/odex_mobile/models/res_users.py b/odex25_mobile/odex_mobile/models/res_users.py index 0df35bd5c..c0fbcaaac 100644 --- a/odex25_mobile/odex_mobile/models/res_users.py +++ b/odex25_mobile/odex_mobile/models/res_users.py @@ -69,6 +69,7 @@ class Users(models.Model): d["employe_id"] = employee.id if employee and employee.id else None d["attendance_status"] = attendance_status if attendance_status else None d['is_approve'] = 'group_division_manager' in d.get('groups',[]) + d['has_two_periods'] = not employee.resource_calendar_id.is_full_day if employee.resource_calendar_id else False res.append(d) return res[0] if single else res