Skip to content

[FIX] hr_holidays: accrual plan day selection#5041

Open
renol-odoo wants to merge 1 commit intomaster-hr-onboarding-renolfrom
master-hr-onboarding-accrual_restrict_date-renol
Open

[FIX] hr_holidays: accrual plan day selection#5041
renol-odoo wants to merge 1 commit intomaster-hr-onboarding-renolfrom
master-hr-onboarding-accrual_restrict_date-renol

Conversation

@renol-odoo
Copy link

Disable selecting non existing day of the month in accrual plan milestones.
Task: 5998551

@robodoo
Copy link

robodoo commented Mar 3, 2026

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

@renol-odoo renol-odoo force-pushed the master-hr-onboarding-accrual_restrict_date-renol branch from 259dc54 to ba94da9 Compare March 5, 2026 09:17
Copy link

@ziriraha ziriraha left a comment

Choose a reason for hiding this comment

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

Great idea to use useEffect! one small comment

Comment on lines +31 to +36
_buildDayOptions(maxDays) {
return Array.from({ length: maxDays }, (_, i) => {
const day = i + 1;
return [String(day), String(day)];
});
}

Choose a reason for hiding this comment

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

We already have the options, why not filter them instead of building them?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, indeed... I've updated it so that it builds the array once and then return the appropriate slice

@renol-odoo renol-odoo force-pushed the master-hr-onboarding-accrual_restrict_date-renol branch from ba94da9 to a7c32be Compare March 13, 2026 12:18
Comment on lines +11 to +14
const ALL_DAY_OPTIONS = Array.from({ length: 31 }, (_, i) => {
const day = String(i + 1);
return [day, day];
});

Choose a reason for hiding this comment

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

what I meant is that super.options has an array with all the options, you can just filter that, no need to build it :) I don't know if they're sorted though (for the .slice)

Copy link
Author

Choose a reason for hiding this comment

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

Mmmm all right, I'll see how I can use that

@renol-odoo renol-odoo force-pushed the master-hr-onboarding-accrual_restrict_date-renol branch from a7c32be to 4ae26d1 Compare March 13, 2026 13:02
Disable selecting non existing day of the month in accrual plan milestones
Task: 5998551
@renol-odoo renol-odoo force-pushed the master-hr-onboarding-accrual_restrict_date-renol branch from 4ae26d1 to adad142 Compare March 13, 2026 13:05
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