Skip to content

[FIX] hr_holidays: fix traceback in virtual leaves search#5149

Open
ahmedamein100 wants to merge 1 commit intomaster-hr-onboarding-ahnaefrom
master-hr-onboarding-time_off_traceback-ahnae
Open

[FIX] hr_holidays: fix traceback in virtual leaves search#5149
ahmedamein100 wants to merge 1 commit intomaster-hr-onboarding-ahnaefrom
master-hr-onboarding-time_off_traceback-ahnae

Conversation

@ahmedamein100
Copy link
Copy Markdown

Pass the comparison value to the operator in _search_virtual_remaining_leaves to prevent a TypeError when navigating via smart buttons.

Task: 6194971

@robodoo
Copy link
Copy Markdown

robodoo commented May 6, 2026

This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding-ahnae, it needs to be retargeted before it can be merged.

Copy link
Copy Markdown

@Mahmoudk3m Mahmoudk3m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work 🚀 Just a small comment.
The code is good but the commit message doesn't follow the guidelines. Also, for bug fix, we need to have a structure like this: Steps to reproduce, Bug cause, Solution.

Also, while it's not mandatory. It's a best practice to write a test for bug fixes.

Steps to reproduce:

1. Go to Time Off > Configuration > Time Off Types.

2. Open any type and click the 'Time Off' smart button.

3. Click 'New' or attempt to filter/search on the resulting view.

4. A TypeError occurs during the evaluation of the remaining leaves.

Bug:

In `_search_virtual_remaining_leaves`, the operator `op` was being called without its second argument (the comparison value).

Solution:

Pass the comparison value to the operator in `_search_virtual_remaining_leaves` to ensure the comparison is evaluated correctly and prevent the TypeError.

task: 6194971
@ahmedamein100 ahmedamein100 force-pushed the master-hr-onboarding-time_off_traceback-ahnae branch from b1d3006 to c4c5662 Compare May 8, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants