Skip to content

Commit

Permalink
[IMP] hr_attendance_missing_days: don't break on multi work day atten…
Browse files Browse the repository at this point in the history
…dances (#1)

* [IMP] hr_attendance_missing_days: don't break on multi work day attendances

* [ADD] hr_attendance_contract_missing_days: tests

* fixup! [ADD] hr_attendance_contract_missing_days: tests
  • Loading branch information
hbrunn authored and Highcooley committed Jan 23, 2024
1 parent 9ba0996 commit 70c8a40
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions hr_attendance_contract_missing_days/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_hr_attendance_contract_missing_days
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from odoo.addons.hr_attendance_missing_days.tests import test_attendance


class TestAttendance(test_attendance.TestAttendance):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.contract = cls.env["hr.contract"].create(
{
"name": "2023",
"date_start": "2023-01-01",
"date_end": "2023-12-31",
"state": "open",
"wage": 42,
"employee_id": cls.employee.id,
}
)

def _clone_employee(self, employee, defaults):
result = super()._clone_employee(employee, defaults)
for contract in employee.contract_ids:
contract.copy({"employee_id": result.id, "state": "open"})
return result

0 comments on commit 70c8a40

Please sign in to comment.