[IMP] hr_holidays: Accrual UX - Day in month range - #5240
Open
sdemeesterde wants to merge 1 commit into
Open
Conversation
In Time Off > Configuration > Accrual Plans > New, When selecting a day-month combination in the configuration section or the milestone section, the dropdown selection field for the day has a default range from 1 to 31, no matter the accociated month. The backend checks the range, but to improve UX experience, a dynamic custom selection widget is implemented to filter on the month. E.g, the month of September should display a range from 1 to 30. Worth noting that for February, the range is 1-29 (included). As mention in the task, and what the backend accepts. task: 6455797
|
This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding-samde, it needs to be retargeted before it can be merged. |
sdemeesterde
commented
Aug 11, 2026
Comment on lines
+7
to
+13
| const DEFAULT_MONTH_MAPPING = { | ||
| first_day: "first_month", | ||
| first_month_day: "first_month", | ||
| second_month_day: "second_month", | ||
| yearly_day: "yearly_month", | ||
| carryover_day: "carryover_month", | ||
| }; |
Author
There was a problem hiding this comment.
I somehow got into trouble with the "options" parameter which is apparently not so reliable. As a result, I use this fallback mapping.
But this makes me wonder:
- Is this good practice ?
- How defensive should we write javascript ? For example I could have added additionnal checks for the monthValue variable (accepts more month formats)
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.
In Time Off > Configuration > Accrual Plans > New, When selecting a day-month combination in the configuration section or the milestone section, the dropdown selection field for the day has a default range from 1 to 31, no matter the accociated month.
The backend checks the range, but to improve UX experience, a dynamic custom selection widget is implemented to filter on the month. E.g, the month of September should display a range from 1 to 30.
Worth noting that for February, the range is 1-29 (included). As mention in the task, and what the backend accepts.
task: 6455797