Skip to content

[18.0][IMP] resource_booking: cap suggested slots with max_advance_booking_days#220

Open
dnplkndll wants to merge 1 commit into
OCA:18.0from
ledoent:18.0-imp-resource_booking-max_advance_booking_days
Open

[18.0][IMP] resource_booking: cap suggested slots with max_advance_booking_days#220
dnplkndll wants to merge 1 commit into
OCA:18.0from
ledoent:18.0-imp-resource_booking-max_advance_booking_days

Conversation

@dnplkndll
Copy link
Copy Markdown
Contributor

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 (office desks released only one week ahead, sales-call windows that should not commit dates beyond a planning horizon).

Adds 3 tests in tests/test_backend.py: test_max_advance_booking_days_caps_slots, ..._zero_keeps_full_range, ..._constraint.

/ocabot merge minor

…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>
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

@brenden-eshbach
Copy link
Copy Markdown

Thanks for your work on this @dnplkndll

@dnplkndll dnplkndll force-pushed the 18.0-imp-resource_booking-max_advance_booking_days branch from 29cef86 to 768dbea Compare May 20, 2026 14:14
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.

3 participants