From 21159924ed0055edf24c43fd8c655c208cc1e1e5 Mon Sep 17 00:00:00 2001 From: Bakry Date: Thu, 1 Aug 2024 17:21:21 +0300 Subject: [PATCH 1/2] fix --- .../static/src/xml/self_service_dashboard.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odex25_base/system_dashboard_classic/static/src/xml/self_service_dashboard.xml b/odex25_base/system_dashboard_classic/static/src/xml/self_service_dashboard.xml index 78042e911..2f78135ed 100644 --- a/odex25_base/system_dashboard_classic/static/src/xml/self_service_dashboard.xml +++ b/odex25_base/system_dashboard_classic/static/src/xml/self_service_dashboard.xml @@ -84,9 +84,9 @@

Attendance

-

+ From 5c6fe53210a69768a490b5d47de9e447fda85115 Mon Sep 17 00:00:00 2001 From: Bakry Date: Thu, 1 Aug 2024 17:36:03 +0300 Subject: [PATCH 2/2] fix --- odex25_base/system_dashboard_classic/models/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/odex25_base/system_dashboard_classic/models/models.py b/odex25_base/system_dashboard_classic/models/models.py index c86048fde..e5248e877 100644 --- a/odex25_base/system_dashboard_classic/models/models.py +++ b/odex25_base/system_dashboard_classic/models/models.py @@ -438,16 +438,20 @@ class SystemDashboard(models.Model): } return attendance_date else: + result = attendance.create(vals_in) # check whether last action sign in or out and its date attendance = self.env['attendance.attendance'].sudo().search( [('employee_id', '=', employee_object.id), ('action_date', '=', t_date)]) + user_tz = pytz.timezone(self.env.context.get('tz', 'Asia/Riyadh') or self.env.user.tz) #add + time_object = fields.Datetime.from_string(attendance[-1].name) #add + time_in_timezone = pytz.utc.localize(time_object).astimezone(user_tz) #add is_attendance = True if not attendance: is_attendance = False if attendance and attendance[-1].action == 'sign_out': is_attendance = False attendance_date = {'is_attendance': is_attendance, - 'time': attendance[-1].name if attendance else False + 'time': time_in_timezone if attendance else False } return attendance_date