View types
Sumeru workspace views are declared in XML (type on ) and rendered by SWC components registered in core/swc/src/main.ts. Include view modes in window actions: view_mode="kanban,list,form".
Live examples: every type below is implemented in sumeru_custom_addons/addons/engagement_cookbook/views/ — see engagement_cookbook cookbook.
Summary
| Type | SWC class | Status | Purpose |
|---|---|---|---|
list / tree | ListView | Full | Tabular records, search, bulk delete |
form | FormView | Full | Single-record edit with sheet layout |
kanban | KanbanView | Full | Board grouped by a field |
pivot | PivotView | Full | HTML aggregation table |
graph | GraphView | v1 | Bar chart via read_group RPC |
calendar | CalendarView | v1 | Date-bucketed event list |
gantt | GanttView | v1 | CSS bars from date_start–date_stop |
map | MapView | v1 | Marker list + OpenStreetMap links |
cohort | CohortView | v1 | Period table from date_start + measure |
List / tree
<view id="view_crm_lead_tree" model="crm.lead" type="list">
<field name="name"/>
<field name="partner_id"/>
<field name="stage_id"/>
<field name="priority" widget="priority"/>
<field name="user_id"/>
</view>| View attribute | Effect |
|---|---|
open="0" | Disable row click → form |
SWC behaviour: Toolbar with New, search (?q= param), export/import, row selection + bulk delete, server page/sort. When two or more rows are selected, list header object buttons (arch.header.buttons) run via call with active_ids. Row click opens form via SPA navigation.
Form
<view id="view_crm_lead_form" model="crm.lead" type="form">
<header>
<button name="action_convert_wizard" type="object" string="Convert"/>
<button name="action_merge_wizard" type="object" string="Merge"/>
<button name="action_lost_wizard" type="object" string="Lost"/>
<field name="stage_id" widget="statusbar" options="clickable:1"/>
</header>
<sheet>
<div class="sum_title">
<h1><field name="name"/></h1>
</div>
<div class="sum_button_box">
<button type="object" name="action_view_opportunities" string="Opportunities"/>
</div>
<group>
<group string="Lead">
<field name="partner_id"/>
<field name="email" widget="email"/>
<field name="phone" widget="phone"/>
</group>
<group string="Assignment">
<field name="user_id"/>
<field name="priority" widget="priority"/>
</group>
</group>
<notebook>
<page string="Internal notes">
<field name="description" widget="text"/>
</page>
</notebook>
</sheet>
<chatter/>
</view>Form layout CSS classes
| Div class | Effect |
|---|---|
sum_title | Hero title row (optional avatar column) |
sum-title-contact-row | Inline email/phone under title |
sum_button_box / button_box | Stat buttons row |
SWC behaviour: Record toolbar (Edit/Save/Cancel/New/Duplicate/Delete), field widgets via registry, optional ChatterPanel when is present. Object buttons toast RPC errors; validation stays inline. Wizards that return {open} open a form dialog; {close} dismisses it without an extra success toast.
Kanban
<view id="view_crm_lead_kanban" model="crm.lead" type="kanban"
default_group_by="stage_id" records_draggable="1">
<field name="name"/>
<field name="partner_id"/>
<field name="priority" widget="priority"/>
<field name="user_id" widget="many2one"/>
</view>| View attribute | Effect |
|---|---|
default_group_by | Column group field |
group_by | Allowed group fields |
records_draggable | Drag cards between columns |
quick_create | Inline create in a grouped column. Off when 0 / false / off / no. Default on when grouped. |
SWC behaviour: Toolbar with New + search (?q=), grouped columns from server arch.kanban.columns, card click opens form. Quick-create merges workspace defaults into rpc.create. Drag-move errors toast; successful moves stay silent.
Pivot
<view id="view_sale_order_pivot" model="sale.order" type="pivot">
<field name="partner_id" type="row"/>
<field name="date_order" type="col"/>
<field name="amount_total" type="measure"/>
</view>Read-only HTML table. Aggregates up to 500 rows from action domain.
Graph
Same field roles as pivot (type="row|col|measure" on fields). SWC GraphView calls read_group RPC and renders a bar chart (v1).
Calendar
List-style arch with date/datetime fields. SWC buckets records by date for a month grid (v1).
Gantt (v1)
<gantt date_start="date_start" date_stop="date_stop">
<field name="name"/>
<field name="date_start"/>
<field name="date_stop"/>
</gantt>Or . Rows are records; bar left/width come from the date range versus the visible scale (day/week/month). Click opens form. Same record set as calendar (500-row collection load).
Map (v1)
<map latitude="latitude" longitude="longitude">
<field name="name"/>
<field name="latitude"/>
<field name="longitude"/>
</map>No map SDK. Rows with numeric lat/lng become a list plus an OpenStreetMap link (?mlat=&mlon=). Clicking the name opens form. Rows without coordinates are skipped.
Cohort (v1)
<cohort date_start="create_date" interval="month" measure="amount">
<field name="create_date"/>
<field name="amount"/>
</cohort>interval is week or month (default month). measure is a numeric field, or record count when omitted. Client-side HTML table from payload.records (same 500-row cap as pivot). Later-period cells show that period’s measure (not server-side retention SQL).
Report toolbar
On list, form, and kanban views:
<view model="sale.order" type="list" report_download="csv,pdf" bulk_upload="1">Or nested:
<report download="csv,pdf" upload="1"/>Enables Export CSV/PDF and Import CSV in the SWC toolbar.