diff --git a/odex25_hr/attendances/models/hr_attendance_register.py b/odex25_hr/attendances/models/hr_attendance_register.py index 8f884ccad..a5eb0e795 100644 --- a/odex25_hr/attendances/models/hr_attendance_register.py +++ b/odex25_hr/attendances/models/hr_attendance_register.py @@ -61,8 +61,8 @@ class HrAttendanceRegister(models.Model): priv_register = self.env['hr.attendance.register'].search([('employee_id', '=', item.employee_id.id),('id','!=',item.id)]) for reg in priv_register: date = datetime.strptime(str(reg.action_date), '%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d') - #if date == currnt_date: - # raise exceptions.Warning(_('You can not Register Attendance More Than once in The Same day')) + if date == currnt_date: + raise exceptions.Warning(_('You can not Register Attendance More Than once in The Same day')) if currnt_date > str(item.register_date): raise exceptions.Warning(_('You can not Register Attendance At Future Date'))