[IMP] resource_booking: per-resource booking buffer (post-booking cooldown)#4
[IMP] resource_booking: per-resource booking buffer (post-booking cooldown)#4dnplkndll wants to merge 1 commit into
Conversation
Followup notes from the Techsystech reviewThese two cleanups are not part of this PR but were flagged during the review of Brenden Eshbach's (Techsystech) branch that this PR was extracted from. Recording here so they don't get lost. Followup A — portal helpers hardcode US locale and one method shadows itself
Plan: push these helpers into the consumer ( Followup B — portal template + SCSS refreshBrenden's branch also ships visual portal changes ( SourceCombined review branch: For later review with Brenden — not yet pinged. |
dab13c8 to
9cd32e3
Compare
OCA upstream readiness cleanupForce-pushed an amend that drops two non-substantive files from the diff so this branch is ready to lift directly into an OCA upstream PR:
The substantive code/tests are unchanged. Used Reference: OCA quality checklist, rules A3 (no manual version bumps) and A5 (no direct README.rst edits). |
a2366b0 to
9db1b78
Compare
…ldown) Add a Float field booking_buffer (hours, SQL-constrained nonnegative, default 0) on resource.resource. When non-zero, the resource is treated as busy for that many hours after each scheduled booking ends, so the next slot cannot start within the cooldown window. Wire it into _get_intervals via a new _get_buffered_booking_intervals helper that scans recently-ending overlapping bookings sharing at least one buffered resource, then subtracts the cooldown windows from the candidate availability. Default 0 preserves the existing back-to-back slot behavior. Useful for resources that need cleanup/reset/turnaround time between appointments (rooms, equipment, etc.) without inflating the booking duration itself. Co-Authored-By: Brenden Eshbach <brenden@techsystech.com>
9db1b78 to
1e5644e
Compare
Summary
Adds a Float field
booking_buffer(hours, SQL-constrained nonnegative, default 0) onresource.resource. When non-zero, the resource is treated as busy for that many hours after each scheduled booking ends, so the next slot cannot start within the cooldown window.Wires it into
_get_intervalsvia a new_get_buffered_booking_intervalshelper that scans recently-ending overlapping bookings sharing at least one buffered resource, then subtracts the cooldown windows from the candidate availability. Default 0 preserves the existing back-to-back slot behavior.Useful for resources that need cleanup/reset/turnaround time between appointments (rooms, equipment, etc.) without inflating the booking duration itself.
Test plan
booking_buffer = 1.0on a resource, create a 30-min booking ending at 09:00, verify portal cannot offer 09:30 but can offer 10:00Provenance
Surgical extraction from Brenden Eshbach's (Techsystech) work on the website_appointment_booking PR fork: see review branch
18.0-techsystech-review-resource_bookingfor the original combined diff.