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".
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 | Stub | Placeholder |
map | MapView | Stub | Placeholder |
cohort | CohortView | Stub | Placeholder |
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).
Stub views
gantt, map, and cohort register in SWC but render placeholder UI. Do not rely on them in production modules yet.
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.