diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml
index 6bc745d2a06895..69fda10997f59c 100644
--- a/addons/hr/views/hr_employee_views.xml
+++ b/addons/hr/views/hr_employee_views.xml
@@ -383,7 +383,7 @@
to
-
+
diff --git a/addons/hr_holidays/models/hr_work_entry_type.py b/addons/hr_holidays/models/hr_work_entry_type.py
index e46dc79cb57805..0ca232a9a4903e 100644
--- a/addons/hr_holidays/models/hr_work_entry_type.py
+++ b/addons/hr_holidays/models/hr_work_entry_type.py
@@ -279,7 +279,7 @@ def _search_max_leaves(self, operator, value):
def _search_virtual_remaining_leaves(self, operator, value):
def is_valid(work_entry_type):
- return not work_entry_type.requires_allocation or op(work_entry_type.virtual_remaining_leaves)
+ return not work_entry_type.requires_allocation or op(work_entry_type.virtual_remaining_leaves, value)
op = PY_OPERATORS.get(operator)
if not op:
return NotImplemented
diff --git a/addons/hr_holidays/tests/test_hr_work_entry_type.py b/addons/hr_holidays/tests/test_hr_work_entry_type.py
index aca98678c86190..45e8c11f3dbb2d 100644
--- a/addons/hr_holidays/tests/test_hr_work_entry_type.py
+++ b/addons/hr_holidays/tests/test_hr_work_entry_type.py
@@ -232,3 +232,20 @@ def test_change_count_days_as(self):
with self.assertRaises(ValidationError):
work_entry_type.count_days_as = 'working'
+
+ def test_search_virtual_remaining_leaves(self):
+ """
+ Test searching on the computed field 'virtual_remaining_leaves'
+ does not throw a TypeError missing the 'value' argument.
+ """
+ employee = self.env['hr.employee'].create({'name': 'Test Employee'})
+ result = self.env["hr.work.entry.type"].with_context(employee_id=employee.id).search(
+ [
+ ("virtual_remaining_leaves", ">", 0),
+ ],
+ )
+
+ self.assertTrue(
+ isinstance(result, type(self.env["hr.work.entry.type"])),
+ "The search should return a valid recordset without crashing.",
+ )