[FIX] hr_holidays: fix search on virtual_remaining_leaves - #5214
Merged
HashemKhaled merged 1 commit intoAug 7, 2026
Merged
Conversation
|
This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding-tomic, it needs to be retargeted before it can be merged. |
HashemKhaled
requested changes
Aug 5, 2026
HashemKhaled
left a comment
There was a problem hiding this comment.
Thanks for your work 🚀
The bug is also reproducible if the time type does not require allocation, so let's make the commit message more generic to include all possible cases. I think it is enough to just try creating a time off and pressing the time type, the bug appears directly.
I am waiting for the test to be added as well.
tonymchl
force-pushed
the
master-hr-onboarding-traceback_time_off_type-tomic
branch
2 times, most recently
from
August 6, 2026 06:24
9d6f3f3 to
6eeeab5
Compare
Steps to reproduce: - Open the Time Off app. - Create a new time off request. - Click on the "Time Off Type" dropdown field. - A traceback occurs (TypeError: gt expected 2 arguments, got 1). Cause: In `hr_work_entry_type.py`, the `_search_virtual_remaining_leaves` method's internal `is_valid` function evaluates `op(work_entry_type.virtual_remaining_leaves)` with only one argument instead of passing the comparison value as the second argument. Solution: Pass `value` as the second argument to `op()` in `_search_virtual_remaining_leaves` (i.e. `op(work_entry_type.virtual_remaining_leaves, value)`). Task: 6446513
tonymchl
force-pushed
the
master-hr-onboarding-traceback_time_off_type-tomic
branch
from
August 6, 2026 14:51
7878335 to
230ccd6
Compare
HashemKhaled
reviewed
Aug 7, 2026
| 'unit_of_measure': 'day', | ||
| }) | ||
|
|
||
| domain = [('virtual_remaining_leaves', '>', 0)] |
There was a problem hiding this comment.
nit: this is referenced only once so you can use it directly where it is needed
res = self.env['hr.work.entry.type'].with_user(self.user_employee_id).name_search(
name='',
domain=[('virtual_remaining_leaves', '>', 0)],
operator='ilike',
limit=8,
)
HashemKhaled
deleted the
master-hr-onboarding-traceback_time_off_type-tomic
branch
August 7, 2026 08:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps to reproduce:
TypeError: gt expected 2 arguments, got 1).Cause:
In
hr_work_entry_type.py, the_search_virtual_remaining_leavesmethod's internalis_validfunction evaluatesop(work_entry_type.virtual_remaining_leaves)with only one argument instead of passing the comparison value as the second argument.Solution:
Pass
valueas the second argument toop()in_search_virtual_remaining_leaves(i.e.op(work_entry_type.virtual_remaining_leaves, value)).Task: 6446513