Skip to content

[19.0][MIG] hr_holidays_natural_period: Migration to version 19.0#240

Open
cristina-hidalgo-tecnativa wants to merge 31 commits intoOCA:19.0from
Tecnativa:19.0-mig-hr_holidays_natural_period
Open

[19.0][MIG] hr_holidays_natural_period: Migration to version 19.0#240
cristina-hidalgo-tecnativa wants to merge 31 commits intoOCA:19.0from
Tecnativa:19.0-mig-hr_holidays_natural_period

Conversation

@cristina-hidalgo-tecnativa
Copy link
Copy Markdown

@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa commented Jan 29, 2026

  • Changed contains(@class, 'o_row') to hasclass('o_row')
  • Create leave_type dynamically instead of using non-existent XML ID
  • Added workaround in _natural_period_intervals_batch to handle edge case where old_request_unit='day' comes without proper context
  • Ensures natural days always use full day calculation (24h) instead of half-day (12h)

@Tecnativa TT60290
@christian-ramos-tecnativa

victoralmau and others added 22 commits January 27, 2026 15:40
…ve types

[UPD] Update hr_holidays_natural_period.pot

[UPD] README.rst
…ployee is not set yet

hr_holidays_natural_period 13.0.1.0.1
… employee set yet

hr_holidays_natural_period 13.0.1.0.2
…ion.

Previously, the _exist_interval_in_date () function always returned False, which always created a new interval.
Although this was totally incorrect, it was detected in a real use case when there were working days and holidays in the date range causing incorrect overtime.
TT33779

hr_holidays_natural_period 13.0.1.0.3
TT37026

[UPD] Update hr_holidays_natural_period.pot

[UPD] README.rst
Currently translated at 100.0% (6 of 6 strings)

Translation: hr-holidays-16.0/hr-holidays-16.0-hr_holidays_natural_period
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-16-0/hr-holidays-16-0-hr_holidays_natural_period/es/

[UPD] README.rst
…reation

It is necessary to recalculate the duration value in the create() method when it is done by UX.

Fixes OCA#105
[UPD] Update hr_holidays_natural_period.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-holidays-17.0/hr-holidays-17.0-hr_holidays_natural_period
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-17-0/hr-holidays-17-0-hr_holidays_natural_period/
Currently translated at 100.0% (9 of 9 strings)

Translation: hr-holidays-17.0/hr-holidays-17.0-hr_holidays_natural_period
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-17-0/hr-holidays-17-0-hr_holidays_natural_period/it/
…n some use cases.

Example use case:
- Calendar Monday 16:00-21:00
- Calendar Tuesday-Friday: 09:00-14:00
- Absence from Monday to Sunday in natural day
- Number of days: 7

This is due to the rrule we are using to generate the missing intervals for the non
working days to simulate the natural period. Previously, we use the starting and
ending time, resulting that the daily rrule was omitting the initial or ending day,
as the theoretical hour is after the ending datetime. For the example above, the
rrule will generate the entries from Monday at 16:00, so when the time for the Sunday
rule comes, as Sun 16:00 is bigger than Sun 14:00, which was the ending datetime,
no iteration is done for Sunday.

The solution is to put the rrule with the min time for the starting limit, and the
maximum for the ending one.

It has been checked that there's no problem with timezones due to this patch.

TT55243

[BOT] post-merge updates
@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa marked this pull request as draft January 29, 2026 07:58
@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa force-pushed the 19.0-mig-hr_holidays_natural_period branch 2 times, most recently from 46c329b to a9fabb0 Compare January 29, 2026 08:07
@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa force-pushed the 19.0-mig-hr_holidays_natural_period branch 2 times, most recently from 6f3b977 to 93b23b6 Compare March 4, 2026 11:00
@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa marked this pull request as ready for review March 4, 2026 11:05
victoralmau and others added 2 commits March 4, 2026 12:07
Currently translated at 100.0% (9 of 9 strings)

Translation: hr-holidays-18.0/hr-holidays-18.0-hr_holidays_natural_period
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-18-0/hr-holidays-18-0-hr_holidays_natural_period/it/
LauraCForgeFlow and others added 7 commits March 4, 2026 12:07
Currently translated at 100.0% (10 of 10 strings)

Translation: hr-holidays-18.0/hr-holidays-18.0-hr_holidays_natural_period
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-18-0/hr-holidays-18-0-hr_holidays_natural_period/it/
When opening an employee that has leaves with natural days, and having
a lot of leaves of this type for all the employees, there's a serious
performance problem, because changing the request unit recomputes all
the leaves of that type.

Using the trick from #60256 of updating just the cache with the desired
value for the computations, avoid heavy recomputations.

TT60256
@cristina-hidalgo-tecnativa cristina-hidalgo-tecnativa force-pushed the 19.0-mig-hr_holidays_natural_period branch from 93b23b6 to 32268a8 Compare March 4, 2026 11:07
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.