This page covers the full lifecycle of a resource booking: creating the record, assigning a resource combination, setting a time slot, confirming attendance, and canceling when necessary. It also explains the modification deadline, the automatic calendar event synchronization, and the activity integration that ties mail activities to booking dates.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OCA/calendar/llms.txt
Use this file to discover all available pages before exploring further.
Creating a Booking
Open the Bookings list
Go to Resource Bookings → Bookings. Switch to List view if you want to see pending bookings as well as scheduled ones (the default Calendar view only shows bookings with a start time).
Select the Booking Type
In the Type field, select the appropriate booking type. The duration, tags, reminders, location, and requester advice are all inherited from the type automatically.
Add the Requester(s)
In the Attendees field (
partner_ids), add one or more res.partner records. The first partner is treated as the primary requester and appears in the auto-generated booking name. All listed partners become attendees on the linked calendar event.Assign a combination or leave it to Auto Assign
By default Auto Assign (
combination_auto_assign) is checked. When a start time is set, the system automatically picks the best available combination based on the booking type’s assignment policy.To override this, uncheck Auto assigned and manually select a Resources Combination. Only combinations linked to the selected booking type appear in the dropdown.Auto-Assigning a Combination
Whencombination_auto_assign = True and a start datetime is present, the system calls _get_best_combination(). This method:
- Prioritizes the currently assigned combination (if any), so an already-assigned combination is not evicted unless it becomes unavailable.
- Iterates through the booking type’s combinations in the order defined by the assignment policy (
sortedby sequence, orrandom). - Returns the first combination whose availability intervals fully contain the requested
[start, stop]interval. - Raises a
ValidationErrorin the portal context if no free combination exists.
Scheduling a Booking
Setting a Start datetime on a booking is the action that triggers scheduling. The system responds by:- Computing
stop = start + duration(in hours). - Calling
_sync_meeting(), which lazily creates acalendar.eventif one does not exist, or updates the existing event’sstart,stop, anddurationif the times have changed. - Adding all requester partners and the user-type resources from the combination as calendar attendees.
- Running
_check_scheduling()to validate the slot.
Removing a scheduled time
Clearing the Start field (or clicking Unschedule) deletes the linkedcalendar.event. The booking returns to pending state without being canceled.
Conflict detection
The_check_scheduling() constraint fires on every save of a scheduled booking. It raises a ValidationError if:
- The booking has a meeting but no resources in its combination.
- The
[start, stop]interval does not fit within the intersection of the booking type’s work calendar and each member resource’s work calendar. - The combination is already occupied by another confirmed calendar event during the requested time.
Confirming a Booking
A booking reaches theconfirmed state automatically — no button press required. The state engine (_compute_state) sets confirmed when both of the following are true:
- A
meeting_idexists (the booking is scheduled). - At least one of the requester partners (
partner_ids) appears as an attendee on the meeting withstate = 'accepted'.
Manually triggering confirmation
Backend users can call Confirm (action_confirm) to mark the requester attendees (and optionally the current user’s attendance) as accepted. The portal /confirm route also calls this method after setting the start time.
Difference between scheduled and confirmed
| State | Meeting exists? | Requester accepted? |
|---|---|---|
scheduled | ✅ Yes | ❌ No |
confirmed | ✅ Yes | ✅ Yes |
scheduled until the requester accepts the calendar invitation — either by clicking Accept in their email client or by the portal confirm route being called.
Canceling a Booking
Click Cancel (or call action_cancel)
Click the Cancel button (or use Action → Cancel in the list view). The system calls
action_cancel(), which:- Calls
action_unschedule()to delete the linkedcalendar.event. - Sets
active = False(archives the booking). - Clears the
access_tokenso any previously shared portal URL becomes invalid.
canceled because active = False.
To view canceled bookings, remove the default Active filter in the list view.
Modification Deadline
Themodifications_deadline field on the booking type defines a cutoff window in hours before the booking start. The is_modifiable computed field evaluates to False for any non-manager user when now > (start - modifications_deadline hours).
How it works
- Portal users always have
using_portal=Truein their context, so they are never treated as managers. - Backend users with the
resource_booking.group_managergroup bypass the deadline and can always modify any booking. - Regular backend users (group
resource_booking.group_user) are also subject to the deadline.
Activities
Resource Booking integrates deeply with Odoo’s mail activity system.Custom activity type
The module registers a custom mail activity type withcategory = resource_booking. Activities of this type can be scheduled directly from the booking’s activity log.
Deadline synchronization
When a mail activity is linked to a booking (via thebooking_id field on mail.activity), its deadline is automatically kept in sync with the booking’s start date. This happens on every create and write that touches start or meeting_id.
calendar_event_id on the activity also enables the Re-schedule button in the Odoo activity block UI, letting users jump directly from an activity to the calendar event.
Activity feedback
When a booking activity is marked as done with feedback text, the module appends that feedback to the booking’s Description field (description). This keeps a persistent HTML record of notes on the booking record itself, in addition to the standard activity log entry.