-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] hr_attendance_missing_days: don't break on multi work day atten…
…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
1 parent
583a3b8
commit ddf28b8
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_hr_attendance_contract_missing_days |
23 changes: 23 additions & 0 deletions
23
hr_attendance_contract_missing_days/tests/test_hr_attendance_contract_missing_days.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters