From 32e47ee4031e9ed1209b1f28e5c4b16f1e910459 Mon Sep 17 00:00:00 2001 From: "Hazem (haabo)" Date: Tue, 2 Dec 2025 16:04:11 +0100 Subject: [PATCH] [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 --- addons/hr_holidays/models/hr_leave_type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py index 4093f0d66dff8..44c72709a2775 100644 --- a/addons/hr_holidays/models/hr_leave_type.py +++ b/addons/hr_holidays/models/hr_leave_type.py @@ -283,7 +283,7 @@ def _search_virtual_remaining_leaves(self, operator, value): leave_types = self.env['hr.leave.type'].search([]) def is_valid(leave_type): - return not leave_type.requires_allocation or op(leave_type.virtual_remaining_leaves) + return not leave_type.requires_allocation or op(leave_type.virtual_remaining_leaves, value) return [('id', 'in', leave_types.filtered(is_valid).ids)] @api.depends_context('employee_id', 'default_employee_id', 'leave_date_from', 'default_date_from')