-
Notifications
You must be signed in to change notification settings - Fork 116
[FIX]: hr_holidays: fix time off type error in time off form view #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master-hr-onboarding-moaln
Are you sure you want to change the base?
[FIX]: hr_holidays: fix time off type error in time off form view #4869
Conversation
|
This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding-moaln, it needs to be retargeted before it can be merged. |
eb044b7 to
ae49b9c
Compare
mepe-odoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ae49b9c to
c44c21b
Compare
1. Go to **Time Off > Configuration > Time Off Types**. 2. Open a type and click the "Time Off" smart button. 3. Click **New**. 4. An error appears. [[Reference Video](https://drive.google.com/file/d/1vi_apL24Km5tSomQtwcTArqqWvrBR5ni/view)] In the `_search_virtual_remaining_leaves` method, the code tries to use an operator (like `>`) to compare the `virtual_remaining_leaves`. This operator requires **two** arguments to work. However, the code was only passing **one** argument, missing the `value` to compare against. This caused the "expects 2 arguments" error. Passed the missing `value` to the operator call so the comparison can be completed correctly. Task: 5241685
c44c21b to
0495318
Compare
|
Thank you very much for your review! |
mepe-odoo
left a comment
There was a problem hiding this 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 :D
| self.assertFalse(leave_types, "Got valid leaves outside vaild period") | ||
|
|
||
| def test_search_virtual_remaining_leaves(self): | ||
| leave_types = self.env['hr.leave.type']._search_virtual_remaining_leaves('>', 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should call the regular search method on the field virtual_remaining_leaves :)

Steps to Reproduce
[Reference Video]
Reason
In the
_search_virtual_remaining_leavesmethod, the code tries to use an operator (like>) to compare thevirtual_remaining_leaves.This operator requires two arguments to work. However, the code was only passing one argument, missing the
valueto compare against. This caused the "expects 2 arguments" error.Solution
Passed the missing
valueto the operator call so the comparison can be completed correctly.Task: 5241685