Skip to content

[FIX] hr_holidays: Time Type domain search crash when opening dropdow… - #5225

Open
sdemeesterde wants to merge 1 commit into
master-hr-onboarding-samdefrom
master-hr-onboarding-task_traceback_on_time_off_type-samde
Open

[FIX] hr_holidays: Time Type domain search crash when opening dropdow…#5225
sdemeesterde wants to merge 1 commit into
master-hr-onboarding-samdefrom
master-hr-onboarding-task_traceback_on_time_off_type-samde

Conversation

@sdemeesterde

@sdemeesterde sdemeesterde commented Aug 7, 2026

Copy link
Copy Markdown

Steps to reproduce the error:

Prerequisite:

  • Have a Time off type (test_timeoff) with
    • "Requires allocation" ticked (= True)
    • "Allow Negative" not ticked (= False)
  • Create a regular allocation (Time Off > Management > Allocations > New)
    to an employee (test_employee) with
    • Time Type = test_timeoff
    • Allocation > 0
  • Validate the allocation

Bug error:

  • Navigate to Time Off > Time Types > Select any time type > Select smart
    button Time off > New
  • Select Employee = test_employee
  • Press Time Type -> ERROR

Reason: The search method for virtual_remaining_leaves has a bug.
The comparison function in _search_virtual_remaining_leaves accepts only one argument,
when two are required.

Solution:

  • Add the missing argument.
  • Add a unit test.

Task: 6449756

@robodoo

robodoo commented Aug 7, 2026

Copy link
Copy Markdown

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

@usseif97 usseif97 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Image

Thanks for your work. The fix is to the point 🎯
Here's how bug-fix tasks are handled, and you got most of it 💪
But, also you should add a test to ensure that the issue doesn't reappear in the future and you should clearly add the test on the appropriate related test file

@sdemeesterde
sdemeesterde force-pushed the master-hr-onboarding-task_traceback_on_time_off_type-samde branch from ec5f334 to e93c0b4 Compare August 10, 2026 08:31
…n btn

Steps to reproduce the error:

Prerequisite:
- Have a Time off type (test_timeoff) with
  - "Requires allocation" ticked (= True)
  - "Allow Negative" not ticked (= False)
- Create a regular allocation (Time Off > Management > Allocations > New)
to an employee (test_employee) with
  - Time Type = test_timeoff
  - Allocation > 0
- Validate the allocation

Bug error:
- Navigate to Time Off > Time Types > Select any time type > Select smart
button `Time off` > New
- Select Employee = test_employee
- Press Time Type -> ERROR

Reason: The search method for virtual_remaining_leaves has a bug.
The comparison function in _search_virtual_remaining_leaves accepts only one argument,
when two are required.

Solution:
- Add the missing argument.
- Add a unit test.

Task: 6449756
@sdemeesterde
sdemeesterde force-pushed the master-hr-onboarding-task_traceback_on_time_off_type-samde branch from e93c0b4 to bf1fb3b Compare August 10, 2026 08:46
'number_of_days': 6,
}).action_approve()

domain = [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No, need for the variable declaration, you can use it directly on the search

@usseif97 usseif97 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for your work
LGTM 🚀

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