[IMP] resource_booking: cap suggested slots with max_advance_booking_days#3
[IMP] resource_booking: cap suggested slots with max_advance_booking_days#3dnplkndll 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. |
7b0d7be to
123dd03
Compare
…days Add an integer field max_advance_booking_days on resource.booking.type (SQL-constrained nonnegative, default 0) and gate _get_available_slots to skip starts beyond now + N days. Default 0 preserves the existing unbounded behavior. Useful when a booking type should not let requesters reserve weeks or months out (e.g. office desks released only one week ahead, sales call windows that should not commit to dates beyond a planning horizon). Co-Authored-By: Brenden Eshbach <brenden@techsystech.com>
123dd03 to
768dbea
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). |
Summary
Adds an integer field
max_advance_booking_daysonresource.booking.type(SQL-constrained nonnegative, default 0) and gates_get_available_slotsto skip starts beyondnow + N days. Default 0 preserves the existing unbounded behavior.Useful when a booking type should not let requesters reserve weeks or months out — e.g. office desks released only one week ahead, sales call windows that should not commit dates beyond a planning horizon.
Test plan
max_advance_booking_days = 7on a booking type; verify portal scheduling page only offers slots within the next 7 daysProvenance
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.