Skip to content

[18.0][FIX] resource_booking: display all slots in the same time zone correctly#183

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
Tecnativa:18.0-fix-resource_booking-timezone
Oct 13, 2025
Merged

[18.0][FIX] resource_booking: display all slots in the same time zone correctly#183
OCA-git-bot merged 1 commit into
OCA:18.0from
Tecnativa:18.0-fix-resource_booking-timezone

Conversation

@carlos-lopez-tecnativa
Copy link
Copy Markdown
Contributor

When using a booking type with a resource calendar that has a different time zone than the resource itself, the slots are returned with mixed time zones. This commit normalizes the behavior and ensures that slots are always returned in the time zone of the booking type.

Steps to reproduce:

Create a resource with the time zone America/Guayaquil, and a calendar that starts from 06:00 to 15:00.

Create a resource booking type with a new calendar that starts from 09:00 to 16:00, and set the time zone to Europe/Madrid.

Before this commit, the slot displayed in the portal was 06:00, but it should have been 12:00. After this commit, the slot is displayed in the correct time zone (Madrid) at 12:00.

Note: The 06:00 in America/Guayaquil corresponds to 12:00 in Madrid standard time, not during daylight saving time. The tests use a freeze date in February.

Forward-port of #168

@Tecnativa @pedrobaeza @victoralmau could you please review this?

…ctly

When using a booking type with a resource calendar that has a different time zone than the resource itself, the slots are returned with mixed time zones.
This commit normalizes the behavior and ensures that slots are always returned in the time zone of the booking type.

Steps to reproduce:

Create a resource with the time zone America/Guayaquil, and a calendar that starts from 06:00 to 15:00.

Create a resource booking type with a new calendar that starts from 09:00 to 16:00, and set the time zone to Europe/Madrid.

Before this commit, the slot displayed in the portal was 06:00, but it should have been 12:00.
After this commit, the slot is displayed in the correct time zone (Madrid) at 12:00.

Note: The 06:00 in America/Guayaquil corresponds to 12:00 in Madrid standard time, not during daylight saving time. The tests use a freeze date in February.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @ows-cloud, @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 18.0 milestone Oct 13, 2025
Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Fast-tracking the fw-port.

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-183-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 36803de into OCA:18.0 Oct 13, 2025
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at af59193. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 18.0-fix-resource_booking-timezone branch October 13, 2025 14:13
dnplkndll added a commit to ledoent/calendar that referenced this pull request May 28, 2026
Forward-port of fixes dropped when [MIG] was written against an older
18.0 baseline:

- OCA#183: restore _get_intervals(tz) + TZ-aware slot conversion so that
  portal slots always display in the booking type's time zone
  (Intervals replaces WorkIntervals from removed hr_work_entry_contract)
- OCA#189: inject event_tz from the resource calendar on meeting creation
  so the calendar event carries the correct time zone from first write
- OCA#214: set description on meeting only when requester_advice is set;
  unconditional assignment broke test_resource_booking_schedule_unschedule
  after odoo/odoo#223875 (Text vs HTML type mismatch)
- OCA#219: honor all-day calendar events when computing busy slots using
  Domain.OR (replaces removed odoo.osv.expression) with start_date/
  stop_date predicate; render full-day interval from analyzer's tz

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll added a commit to ledoent/calendar that referenced this pull request May 29, 2026
Forward-port of fixes dropped when [MIG] was written against an older
18.0 baseline:

- OCA#183: restore _get_intervals(tz) + TZ-aware slot conversion so that
  portal slots always display in the booking type's time zone
  (Intervals replaces WorkIntervals from removed hr_work_entry_contract)
- OCA#189: inject event_tz from the resource calendar on meeting creation
  so the calendar event carries the correct time zone from first write
- OCA#214: set description on meeting only when requester_advice is set;
  unconditional assignment broke test_resource_booking_schedule_unschedule
  after odoo/odoo#223875 (Text vs HTML type mismatch)
- OCA#219: honor all-day calendar events when computing busy slots using
  Domain.OR (replaces removed odoo.osv.expression) with start_date/
  stop_date predicate; render full-day interval from analyzer's tz

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll added a commit to ledoent/calendar that referenced this pull request May 29, 2026
Forward-port of fixes dropped when [MIG] was written against an older
18.0 baseline:

- OCA#183: restore _get_intervals(tz) + TZ-aware slot conversion so that
  portal slots always display in the booking type's time zone
  (Intervals replaces WorkIntervals from removed hr_work_entry_contract)
- OCA#189: inject event_tz from the resource calendar on meeting creation
  so the calendar event carries the correct time zone from first write
- OCA#214: set description on meeting only when requester_advice is set;
  unconditional assignment broke test_resource_booking_schedule_unschedule
  after odoo/odoo#223875 (Text vs HTML type mismatch)
- OCA#219: honor all-day calendar events when computing busy slots using
  Domain.OR (replaces removed odoo.osv.expression) with start_date/
  stop_date predicate; render full-day interval from analyzer's tz

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants