Skip to content

Commit

Permalink
[ADD] fix for verdigado#88, tests for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Dec 23, 2023
1 parent 7c70e82 commit 6727558
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ hr:
hr-attendance:
remotes:
oca: https://github.com/OCA/hr-attendance.git
hbrunn: https://github.com/hbrunn/hr-attendance.git
merges:
- oca 15.0
# https://github.com/OCA/hr-attendance/pull/140
- oca refs/pull/140/head
# PR on the above
- hbrunn 15.0-hr_attendance_missing_days
# https://github.com/OCA/hr-attendance/pull/141
- oca refs/pull/141/head
# https://github.com/OCA/hr-attendance/pull/142
Expand Down
12 changes: 12 additions & 0 deletions verdigado_attendance/tests/test_overtime_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ def test_calculation_employeeA(self):
attendance.check_out += timedelta(hours=1)
self.assertOvertime(employeeA, "2023-08-06", 9 * 60, 0)

self.assertOvertime(employeeA, "2023-08-06", 9 * 60, 0)
self.assertOvertime(employeeA, "2023-08-06", 1.5 * 9 * 60, 0, adjustment=True)
attendance.check_out += timedelta(hours=1)
self.assertOvertime(employeeA, "2023-08-06", 10 * 60, 0)
self.assertOvertime(employeeA, "2023-08-06", 1.5 * 10 * 60, 0, adjustment=True)

# be sure that a day spanning attendance generates overtime records for all days
attendance.apply_holiday_overtime_factor = False
attendance.check_out += timedelta(days=1)
self.assertOvertime(employeeA, "2023-08-06", 34 * 60, 0)
self.assertOvertime(employeeA, "2023-08-07", 0, 8 * 60)

def to_time(self, time_string):
if isinstance(time_string, str):
return datetime.strptime(time_string, "%H:%M:%S").time()
Expand Down

0 comments on commit 6727558

Please sign in to comment.