Skip to content

Commit 32e47ee

Browse files
committed
[FIX] hr_holidays: fix traceback bug when selecting leave type
Steps to reproduce: - On the Time Off app go to Configuration -> Time Off Types - Select any time off type the click the Time Off smart button - Click new and on the creation form try changing the Time Off type for an employee Cause of the bug: - The function that compares the leave type days and the employee's remaining leave days only gets the leave type days as an input, the other argument is missing Fix done: - Passing the input value as the second argument for the op(v1, v2) function task-5380284
1 parent 2afe0c2 commit 32e47ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/hr_holidays/models/hr_leave_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _search_virtual_remaining_leaves(self, operator, value):
283283
leave_types = self.env['hr.leave.type'].search([])
284284

285285
def is_valid(leave_type):
286-
return not leave_type.requires_allocation or op(leave_type.virtual_remaining_leaves)
286+
return not leave_type.requires_allocation or op(leave_type.virtual_remaining_leaves, value)
287287
return [('id', 'in', leave_types.filtered(is_valid).ids)]
288288

289289
@api.depends_context('employee_id', 'default_employee_id', 'leave_date_from', 'default_date_from')

0 commit comments

Comments
 (0)