2 Commits

Author SHA1 Message Date
bc64030847 [IMP] hr_holidays_timeoff_analysis : migrate from version 16 to 18
All checks were successful
pre-commit / pre-commit (pull_request) Successful in 1m26s
2025-10-10 12:18:40 +02:00
517a59b59d [IMP] hr_holidays_timeoff_analysis : apply changes proposed by pre-commit 2025-10-10 11:34:54 +02:00
2 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.ruff_cache/
*.*~
*.pyc

View File

@@ -377,13 +377,13 @@ class TestHrLeaveTimeoffDay(TransactionCase):
def test_public_holidays_between_a_leave(self):
# Leaves the code below commented because
# the default database already has a public holiday on 8th May 2025
# self.env["resource.calendar.leaves"].create(
# {
# "name": "8 mai 2025",
# "date_from": Date.to_date("2025-05-07 22:00:00"),
# "date_to": Date.to_date("2025-05-08 23:00:00"),
# }
# )
self.env["resource.calendar.leaves"].create(
{
"name": "8 mai 2025",
"date_from": Date.to_date("2025-05-07 22:00:00"),
"date_to": Date.to_date("2025-05-08 23:00:00"),
}
)
leave = self.env["hr.leave"].create(
{
"employee_id": self.employee.id,
@@ -438,7 +438,7 @@ class TestHrLeaveTimeoffDay(TransactionCase):
len(timeoff_days), 5, "There should be 5 timeoff days for this leave"
)
leave.state = "draft"
leave.state = "confirm"
self.env["hr.leave.timeoff.day"].cron_manage_timeoff_days()
# Vérifie qu'il n'existe plus de hr.leave.timeoff.day pour ce leave
@@ -475,7 +475,7 @@ class TestHrLeaveTimeoffDay(TransactionCase):
len(timeoff_days), 5, "There should be 5 timeoff days for this leave"
)
leave.state = "draft"
leave.state = "confirm"
leave.unlink()
self.env["hr.leave.timeoff.day"].cron_manage_timeoff_days()