Skip to content

[19.0][MIG] resource_booking: Migration to 19.0#217

Open
dnplkndll wants to merge 7 commits into
OCA:19.0from
ledoent:19.0-mig-resource_booking
Open

[19.0][MIG] resource_booking: Migration to 19.0#217
dnplkndll wants to merge 7 commits into
OCA:19.0from
ledoent:19.0-mig-resource_booking

Conversation

@dnplkndll
Copy link
Copy Markdown
Contributor

@dnplkndll dnplkndll commented May 16, 2026

Summary

Forward-port of resource_booking from 18.0 to the 19.0 series.

Supersedes #187

#187 has been open since 2025-10-19 with no maintainer response and is now 12 commits behind upstream/19.0. The substantive migration work in this PR is unchanged from @tishmen's original PR — this PR re-bases it on current 19.0 and includes the two 18.0 fixes that have since merged upstream, preserved as separate commits with their original authorship (OCA convention for cherry-picked porting fixes).

If @tishmen would prefer to take this over and refresh #187 directly, happy to defer — please tag me. Otherwise, recommend closing #187 in favor of this branch.

Companion PR — #218

This branch also carries #218 as commit 1b3bac2 ([FIX] checklog-odoo.cfg: ignore Killing chrome descendants-or-self warning). #218 is a tiny standalone repo-level config fix that brings OCA/calendar in line with the pattern already in OCA/web, OCA/server-ux, OCA/social, OCA/website and ~16 other OCA repos — without it, CI deterministically fails on the chrome-zombie WARNING from resource_booking's tour tests despite 0 actual test failures.

Reviewers: please merge #218 first; this PR will then rebase cleanly and drop the duplicate commit. If you prefer to drop it from #217 right away, happy to force-push — just say the word.

Commit structure (per OCA convention)

1b3bac2  [FIX] checklog-odoo.cfg: ignore Killing chrome ...  (Don Kendall)    ← duplicate of #218
aa94567  [MIG] resource_booking: Migration to 19.0           (Milan Topuzov)
977d388  [BOT] post-merge updates                             (OCA-git-bot)
6d6582d  [FIX] resource_booking: access error on normal cal   (Víctor Martínez)
5a5befc  [FIX] resource_booking: display all slots in the     (Carlos Lopez)
         same time zone correctly
076e2e5  [BOT] post-merge updates                             (OCA-git-bot)

The 2 [FIX] cherry-picks from 18.0 retain their original authors (Víctor Martínez @victoralmau, Carlos Lopez @carlos-lopez-tecnativa) per OCA porting-fix convention. The [MIG] commit on top is @tishmen's transformation, amended only to:

  • carry forward resource_booking/i18n/*.po from 18.0 (Weblate bootstraps faster)
  • add cssselect to requirements.txt (auto-generated by oca-gen-external-dependencies)

Differs from #187 by

  • Removed test-requirements.txt modification (out-of-scope for single-addon PR)
  • Added two 18.0 porting fixes (#1c59c21 + display-tz fix) as separate cherry-picks
  • Rebased on current upstream/19.0 ([19.0][MIG] resource_booking: Migration to 19.0 #187 was 12 commits behind, missing the post-merge updates and setup metapackage bits since landed)

Test plan

  • CI green (test with Odoo, test with OCB, pre-commit, codecov/patch, codecov/project, runboat/build, unreleased-deps) — verified on the 1b3bac2 retrigger
  • /ocabot merge nobump on merge (first port to a new series — no version bump)

@dnplkndll dnplkndll force-pushed the 19.0-mig-resource_booking branch 3 times, most recently from 21d0bd2 to aa94567 Compare May 16, 2026 10:45
dnplkndll added a commit to ledoent/calendar that referenced this pull request May 16, 2026
Odoo 19.0+ HttpCase tour tests leave renderer/websocket chrome
subprocesses that don't exit when the parent is killed; Odoo's own
test framework reports them via WARNING "Killing chrome descendants-
or-self of N: M remaining". These are benign cleanup notifications
emitted AFTER the test result line, not test failures.

Without this ignore pattern, any 19.0 PR that includes tour tests
in resource_booking (test_portal_no_bookings, test_portal_list_with_
bookings, etc.) deterministically fails CI even when 0 tests fail.

This is an OCA-CI configuration fix, not a module change. Will be
split into its own PR once verified on the OCA#217 retrigger.
@victoralmau
Copy link
Copy Markdown
Member

Please, cherry-pick #222 to commit history before migration commit.

OCA-git-bot and others added 7 commits May 18, 2026 13:37
…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.
When a user had no resource_booking permissions and opened a calendar event linked to a resource booking, he got an unnecessary access error.
…t read access

A user landing on /my that lacks resource.booking read access (e.g. an
internal user not in resource_booking.group_user, an internal account
created by another website-facing module) used to hit a hard AccessError:

- _prepare_home_portal_values called search_count([]) unguarded, breaking
  the entire portal home page when "booking_count" was in counters.
- portal_my_bookings called search_count([]) unguarded, breaking the
  /my/bookings listing for the same users.

Both paths now check Booking.has_access("read") and degrade gracefully
(zero counter, empty list page) instead of raising. Portal users with
the dedicated ACL row keep the existing behavior unchanged.

Distinct from upstream 1c59c21 ([FIX] resource_booking: access error on
normal calendar) which fixed a different surface: the calendar event
form's resource_booking_ids field now hidden via groups= for users
without booking permissions. The portal AccessError addressed here is
a separate bug.

Co-Authored-By: Brenden Eshbach <brenden@techsystech.com>
…ests

Two follow-ups from review of the no-access fix:

- portal_my_bookings: unify the no-access branch with the normal path.
  Previously the no-access branch returned an empty dict for `pager`,
  which is technically harmless because the current template doesn't
  read pager, but is fragile against future template inheritance. Now
  has_access is computed once, search_count is gated, and the rest of
  the function (real portal.pager(total=0), recordset, session, render)
  runs through the single existing code path.
- Tests: replace fragile "no Traceback in response" assertions with
  positive DOM markers. Home test now asserts the .o_portal_my_home /
  .o_portal_wrap wrapper renders; listing test asserts the empty-state
  alert string from the QWeb template appears. Both confirm the
  template actually rendered rather than just "did not crash".
@dnplkndll dnplkndll force-pushed the 19.0-mig-resource_booking branch from 1b3bac2 to 52a2f0d Compare May 18, 2026 17:38
@dnplkndll
Copy link
Copy Markdown
Contributor Author

Done — cherry-picked both commits from #222 (0a4d552 [FIX] + 64d0441 [IMP]) in front of the migration commit, also rebased onto current upstream/19.0 to absorb #223 (copier-template 1.42 update).

Side-effect note: my original [FIX] checklog: ignore chrome-zombie warnings… commit dropped during the rebase — upstream now has a broader WARNING .* Killing chrome descendants-or-self .* pattern in checklog-odoo.cfg that supersedes the narrower one I had, so the commit was redundant. Net result: 7 commits ahead of 19.0 instead of 8.

CI re-running on the force-push. Branch: https://github.com/ledoent/calendar/tree/19.0-mig-resource_booking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants