Skip to content

ResourceTimeline Views

A ResourceTimeline is a booking board. It shows one row per resource, such as a technician, vehicle, room or work centre. The records booked on each resource appear as bars across a Day / Week / Month window. Week is drawn in four-hour columns so a board of hundreds of rows stays fast; moving and resizing still snap to 15 minutes. It reads ordinary records of the view’s model, so there is no read model and no data_method. Changes on the board are saved straight to those records:

  • Drag a bar along its row to reschedule it.
  • Drag a bar onto another row to reassign it.
  • Drag a bar’s edge to change its length.
  • Click or drag across empty time on a row to create a booking for that resource.

Every resource the board covers gets a row, including resources with nothing booked. The free slots are what a dispatcher is looking for, and that is how this view differs from a Calendar grouped by a field. Bookings with no resource collect in an Unassigned row at the top, so dispatching work means dragging it out of that row. If the model makes the resource field required, there is no Unassigned row.

The arch uses the Calendar’s vocabulary: content fields tagged with a display_mode, and options on the container.

- data_type: UiView
name: field_service_order_board_view
identifier: field_service_order_board_view
type: ResourceTimeline
model: FieldServiceOrder
arch:
- resource_filter: Q(groups__identifier='core_internal') # which resources get a row
prevent_overlap: true # refuse double-booking
content:
- type: field
name: name
display_mode: title
- type: field
name: technician # ManyToOne: each related record is a row
display_mode: resource
- type: field
name: scheduled_date
display_mode: start
- type: field
name: duration # Float, in hours; defines the end
display_mode: duration
display_modeRequiredMeaning
resourceyesThe ManyToOne that a bar sits on. Each record of its related model is a row.
startyesWhen the booking starts (Date or Datetime).
endnoWhen the booking ends. Without end or duration, a bar is one hour long.
durationnoA Float of hours that defines the end, used instead of end. Resizing a bar writes the duration; moving a bar writes only the start. Use it when the model stores an estimate rather than an end time.
titlenoThe text on the bar. Defaults to the record’s display name.
colornoWhat colours the bar. A hex Char is used as is; a stage, team or state gives every bar with the same value the same colour, on every screen. Without it, each record gets its own colour.
KeyMeaning
resource_filterA Q-expression over the resource model that chooses which rows appear. Record rules apply as usual. A resource that has bookings in the window but is excluded by the filter still gets a row, because hiding a booking is worse than showing an extra row.
prevent_overlaptrue refuses a drop or resize that would put two bookings on the same resource at the same time, and tells the user why. The Unassigned row never counts as an overlap.
availability_methodA method on the resource model that returns each row’s unavailable time, drawn as shading on that row. Users (board_unavailability on User) give their schedule’s off-hours and holidays, plus approved leave when Time Off is installed. Work centres (board_unavailability on WorkCenter) give their schedule’s closed hours plus recorded downtime. Shading is information, not a lock: a dispatcher can still book overtime.
draggablefalse turns off moving and resizing. Defaults to on.
open_endedtrue treats a blank end as “still running”, such as a vehicle a driver still holds. The bar runs to the far edge of the visible window. Moving it shifts only its start, and it gets an end date only when someone drags its end edge. Without open_ended, a blank end means the booking sits at its start.
resource_scopeA relation that the bookings and the resources both have, such as event for sessions and rooms. Rows are limited to resources in the same scope as the bookings on screen. Filter to one event and all of that event’s rooms appear, used or not, instead of every room of every event. The relation must also be a field node in content, so the bookings carry it.

A QuickCreate node in content sets the form that opens when someone clicks or drags across empty time, exactly as on a Calendar. The new record arrives with the chosen time and the row’s resource already filled in.

A resource model can supply its own, for example rooms with opening hours. Declare a classmethod that takes the row ids and the window, and returns UTC bands keyed by id:

class Room(Model):
async def board_unavailability(cls, resource_ids=None, date_from=None, date_to=None):
# {"<room id>": [["2026-03-02T18:00:00", "2026-03-03T07:00:00"], ...]}
...

date_to is exclusive. Bands are UTC instants: if your source is wall-clock time (a schedule’s “08:00”), convert it with WorkSchedule.wall_bands_to_utc(bands, zone), where zone is that schedule’s or person’s timezone.

The board places each record by its fields’ types, and a wrong type would otherwise produce a board that looks fine but is wrong. So saving the view refuses:

  • a resource that is not a ManyToOne;
  • a start or end that is not a Date or Datetime;
  • a duration that is not a number;
  • both an end and a duration;
  • more than one field with the same role, or a color that is not a field;
  • a resource_scope that is not a ManyToOne to the same model on both sides, or that is missing from content.

Each bar is handled separately. A bar can be moved, resized or reassigned only if that user can write that record: the model’s update right, its record rules, and its _controlled_edits freeze rules are all checked. A frozen resource field blocks reassignment but still allows rescheduling, and a frozen start field does the reverse. There is nothing to declare in the view: the board uses the same rules the server enforces when it saves, so every view gives the same answer.

Put ResourceTimeline in the action’s modes and its view in views, next to the Calendar if there is one:

- data_type: WindowAction
name: Field Service
identifier: field_service_order_action
model: FieldServiceOrder
modes: List, Kanban, Calendar, ResourceTimeline, Map, Form
views:
- - set
- - field_service_order_list_view
- field_service_order_calendar_view
- field_service_order_board_view
- field_service_order_form_view

The view switcher shows it as Board.

Use ResourceTimeline for records that already have a resource and a time window: jobs, bookings, assignments, reservations. The Employee Scheduling app’s shift planner is a separate screen built for rostering, with open shifts, copying last week forward and publishing a week to staff. It is not a ResourceTimeline, and neither one replaces the other.