Skip to content

Commit

Permalink
[FIX] hr_holidays: fix test_leave_whole_company_07 test
Browse files Browse the repository at this point in the history
test_leave_whole_company_07 test was failing due ot the hr_leave_date_check2
constraint.
This constraint check that date_from <= date_to for a leave.

date_from and date_to were not assigned any value before and had a default value
of fields.Datetime.now. Depending on which date_from or date_to is created first,
a few second difference can exist and this violates the hr_leave_date_check2 constraint

task-2726143

closes odoo#82177

X-original-commit: 77a5dfd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
  • Loading branch information
Philippe Wauthy committed Jan 4, 2022
1 parent 33b5e71 commit 7d94171
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/hr_holidays/tests/test_company_leave.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ def test_leave_whole_company_07(self):
'employee_id': employee.id,
'holiday_status_id': self.paid_time_off.id,
'request_date_from': date(2020, 3, 29),
'date_from': datetime(2020, 3, 29, 7, 0, 0),
'request_date_to': date(2020, 4, 1),
'date_to': datetime(2020, 4, 1, 19, 0, 0),
'number_of_days': 3,
} for employee in employees[0:15]])
leaves._compute_date_from_to()
Expand Down

0 comments on commit 7d94171

Please sign in to comment.