From bfa55e42f9eab21c9a14863cb7b328a475df0d82 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Mon, 24 Jul 2017 07:15:31 +0200 Subject: [PATCH] [FIX] hr_attendance: constraint must allow same time for check out/in The constraint does not allow the same check out time as the next check in time which might be rare but a possible and likely use case. opw-756694 Closes #18400 --- addons/hr_attendance/models/hr_attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py index e3211fceb00..b2cee749965 100644 --- a/addons/hr_attendance/models/hr_attendance.py +++ b/addons/hr_attendance/models/hr_attendance.py @@ -91,7 +91,7 @@ class HrAttendance(models.Model): # is the same as the one before our check_in time computed before, otherwise it overlaps last_attendance_before_check_out = self.env['hr.attendance'].search([ ('employee_id', '=', attendance.employee_id.id), - ('check_in', '<=', attendance.check_out), + ('check_in', '<', attendance.check_out), ('id', '!=', attendance.id), ], order='check_in desc', limit=1) if last_attendance_before_check_out and last_attendance_before_check_in != last_attendance_before_check_out: