Skip to content

Commit

Permalink
Revert "[ADD] keep 0 overtime records"
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Nov 30, 2023
1 parent c8db819 commit b425a14
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 60 deletions.
3 changes: 0 additions & 3 deletions verdigado_attendance/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"hr_attendance_autoclose",
"hr_attendance_break",
"hr_attendance_break_autoclose",
"hr_attendance_missing_days",
"hr_holidays_attendance",
"l10n_de_holidays",
"hr_holidays_public_overtime",
Expand All @@ -27,8 +26,6 @@
"data": [
"data/base_ical.xml",
"data/hr_leave_type.xml",
"data/ir_cron.xml",
"data/res_company.xml",
"data/res.lang.csv",
"security/verdigado_attendance.xml",
"security/ir.model.access.csv",
Expand Down
5 changes: 0 additions & 5 deletions verdigado_attendance/data/ir_cron.xml

This file was deleted.

9 changes: 0 additions & 9 deletions verdigado_attendance/data/res_company.xml

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions verdigado_attendance/models/hr_attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,3 @@ class HrAttendance(models.Model):

check_in = DatetimeWithoutSeconds()
check_out = DatetimeWithoutSeconds()

def _update_overtime(self, employee_attendance_dates=None):
"""Recreate missing overtime records"""
result = super()._update_overtime(
employee_attendance_dates=employee_attendance_dates
)
if employee_attendance_dates is None:
employee_attendance_dates = self._get_attendances_dates()
missing_vals = []
for employee, attendance_dates in employee_attendance_dates.items():
dates = [attendance_date for _dummy, attendance_date in attendance_dates]
existing_overtime = self.env["hr.attendance.overtime"].search(
[
("employee_id", "=", employee.id),
("company_id", "=", self.env.company.id),
("date", "in", dates),
]
)
missing_vals += [
{"employee_id": employee.id, "date": attendance_date}
for attendance_date in set(dates)
- set(existing_overtime.mapped("date"))
]
self.env["hr.attendance.overtime"].create(missing_vals)
return result

0 comments on commit b425a14

Please sign in to comment.