[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
This commit is contained in:
Wolfgang Taferner
2017-07-25 15:51:56 +02:00
committed by Nicolas Martinelli
parent 77b68a170d
commit bfa55e42f9
+1 -1
View File
@@ -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: