From 4d4fcf6f21e3df2323c7ab82b09f0784ae1f4a5c Mon Sep 17 00:00:00 2001 From: younes Date: Sun, 20 Jul 2025 13:25:49 +0100 Subject: [PATCH] Problem sending check-in/check-out reminder notifications on official holidays. --- odex25_mobile/odex_mobile/models/hr_employee.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/odex25_mobile/odex_mobile/models/hr_employee.py b/odex25_mobile/odex_mobile/models/hr_employee.py index 68a9867a5..07a041b5c 100644 --- a/odex25_mobile/odex_mobile/models/hr_employee.py +++ b/odex25_mobile/odex_mobile/models/hr_employee.py @@ -100,6 +100,10 @@ class HrEmployee(models.Model): holiday_ids = holiday_obj.search([('employee_id', '=', emp.id),('type', '!=', 'add'), ('date_from', '<=', str(date_now)),('date_to', '>=', str(date_now)), ('state', 'not in', ['draft', 'cancel', 'Refuse'])]) + hr_holiday_officials = self.env['hr.holiday.officials'].search( + [('active', '=', True), ('state', '=', 'confirm'), + ('date_from', '<=', str(date_now)), + ('date_to', '>=',str(date_now))]) attendance_in_ids = attendance_obj.search([('employee_id', '=', emp.id),('action', 'in', ['sign_in']), ('name', '>=', str(min_sign_in)), ('name', '<=', str(max_sign_in))]) @@ -107,7 +111,7 @@ class HrEmployee(models.Model): attendance_out_ids = attendance_obj.search([('employee_id', '=', emp.id),('action', 'in', ['sign_out']), ('name', '>=', str(min_sign_out)), ('name', '<=', str(max_sign_out))]) - if not holiday_ids: + if not holiday_ids and not hr_holiday_officials: if date_now >= min_sign_in and date_now <= max_sign_in and not attendance_in_ids: employee_list.append(emp.id) msg = _('Dear employee, Please Sign-in')