Skip to content

[IMP] hr_holidays: Accrual UX - Day in month range - #5240

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

[IMP] hr_holidays: Accrual UX - Day in month range#5240
sdemeesterde wants to merge 1 commit into
master-hr-onboarding-samdefrom
master-hr-onboarding-task_accrual_ux-samde

Conversation

@sdemeesterde

Copy link
Copy Markdown

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

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
@robodoo

robodoo commented Aug 11, 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.

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",
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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)

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.

2 participants