-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
[16.0][ADD] hr_holidays_natural_period_public #149
[16.0][ADD] hr_holidays_natural_period_public #149
Conversation
Hi @victoralmau, |
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.
IMO this is not necessary, because you can define whether to exclude public holidays or not with https://github.com/OCA/hr-holidays/blob/16.0/hr_holidays_public/models/hr_leave_type.py#L11.
I noticed that even when excluding public holidays with the exclude_public_holidays field mentioned, the computation of the number of days in natural days did not properly exclude public holidays. If we remove the changes in https://github.com/OCA/hr-holidays/pull/149/files#diff-ab3064ebe6a3018dc278f12ada4ba1e2e695dc08fef6a4ceb6f0c3c935b3ea24 and execute the tests, those that involve excluding public holidays fail (test_hr_leave_natural_day_public_holiday_02, test_hr_leave_natural_day_public_holiday_weekend_02). However, with the changes introduced in this PR, all tests pass successfully. |
Excuse me, one important thing. The |
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.
As said by my colleague, the module was conceived to always compute natural days without excluding public holidays, as that's how all our companies that are using it work.
Anyway, the module can be extended to be compatible with such configuration. What is not correct is to change the current module dependency, nor adapting data through migration script. Due to both things, although we may do a "soft dependency" only injecting the context, that means the migration script and to trick the tests, I think the best to do in this case is that you create a glue module hr_holidays_natural_period_public
that do the bridge, and install when you need natural periods, but excluding public holidays.
1768a5f
to
5728601
Compare
After taking a deeper look, I completely agree with you. I have changed my code into a new glue module as you requested. |
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 considering the changes.
/ocabot merge nobump
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 18c74de. Thanks a lot for contributing to OCA. ❤️ |
This glue module allows for the leave days computation in natural days to exclude public holidays.