Skip to content

Commit 629cf13

Browse files
committed
fixup! [ADD] #57 allow higher value overtime for holidays
1 parent 609a146 commit 629cf13

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

verdigado_attendance/models/hr_attendance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def _update_overtime(self, employee_attendance_dates=None):
2020
result = super()._update_overtime(
2121
employee_attendance_dates=employee_attendance_dates
2222
)
23+
if not self.exists():
24+
return result
2325
if employee_attendance_dates is None:
2426
employee_attendance_dates = self._get_attendances_dates()
2527

verdigado_attendance/tests/test_overtime_calculation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def test_calculation_employeeA(self):
156156
attendance.check_out += timedelta(hours=1)
157157
self.assertOvertime(employeeA, "2023-08-06", 34 * 60, 0)
158158
self.assertOvertime(employeeA, "2023-08-06", 1.5 * 34 * 60, 0, adjustment=True)
159+
attendance.unlink()
160+
self.assertOvertime(employeeA, "2023-08-06", 0, 0)
161+
self.assertOvertime(employeeA, "2023-08-06", 0, 0, adjustment=True)
159162

160163
def to_time(self, time_string):
161164
if isinstance(time_string, str):

0 commit comments

Comments
 (0)