Skip to content

Dashboard Views

Dashboard views provide a configurable home screen with KPI cards, charts, lists, and goal widgets. The system supports a Standard dashboard (read-only, defined by modules) and personal dashboards (user-created, fully editable).

The Standard dashboard is computed on-the-fly from the view architecture. It is never saved to the database and is always read-only. Each module contributes widgets via view inheritance, so the Standard dashboard automatically reflects all installed modules.

Users see only widgets matching their security groups.

Users can create personal dashboards stored in the DashboardPreference model. Personal dashboards support:

  • Drag-and-drop widget repositioning
  • Widget resizing
  • Adding/removing widgets
  • Renaming and deleting dashboards

Each user’s dashboards are private (enforced by a RecordRule).

The base dashboard is defined in the core module:

- data_type: UiView
name: Home Dashboard
identifier: home_dashboard_view
type: Dashboard
model: DashboardPreference
arch:
- type: row
anchor: dashboard_greeting
content:
- type: column
span: 12
content:
- type: widget
widget: Greeting
groups:
- core_internal
properties:
title: Welcome
showDate: true
showIcon: true
- type: row
anchor: dashboard_core_kpis
content:
- type: column
span: 3
content:
- type: widget
widget: KPICard
groups:
- core_internal
properties:
title: Contacts
model: Contact
mode: count
filter: (Q(active=True))
label: Active Contacts
icon: Users
color: blue

Dashboard arch uses rows and columns like form views:

ElementDescription
rowHorizontal container. Use anchor for stable inheritance targeting.
columnGrid column with span (1-12).
widgetDashboard widget with widget type, groups, and properties.
- type: widget
widget: KPICard # Widget type
groups: # Access control (optional)
- sales_user_group
properties: # Widget-specific configuration
model: SaleOrder
mode: count
filter: (Q(state='Confirmed'))
label: Sales Orders
icon: ShoppingCart
color: blue

Modules add widgets to the Standard dashboard using view inheritance. Always add an anchor to your rows for other modules to target.

- depends:
- ../security/security.yaml
data_type: UiView
name: Home Dashboard - Sales
identifier: home_dashboard_sales
type: Dashboard
model: DashboardPreference
inherited_view: home_dashboard_view
arch:
operations:
- action: add
target:
anchor: dashboard_core_kpis
position: after
value:
type: row
anchor: dashboard_sales_kpis
content:
- type: column
span: 3
content:
- type: widget
widget: KPICard
groups:
- sales_user_group
properties:
title: Quotations
model: SaleOrder
mode: count
filter: (Q(state='Quote') | Q(state='Sent'))
label: Active Quotes
icon: FileText
color: blue

Key points:

  • Use inherited_view: home_dashboard_view to extend the Standard dashboard
  • Target existing anchors (e.g., dashboard_core_kpis) with position: after
  • Always add an anchor to your new rows so other modules can extend after them
  • Use security groups on widgets for access control

Displays a single aggregated metric with icon, label, and formatted value. When the value changes (a refresh, or a different filter), its digits roll to the new figure. Values of a thousand and more are shortened to one decimal (12.5K, 3.2M).

widget: KPICard
properties:
model: SaleOrder
mode: count # count, sum, average, min, max
measure: total # Required when mode != count
filter: (Q(state='Confirmed'))
label: Sales Orders
icon: ShoppingCart # Lucide icon name
color: blue # Mantine color
format: number # number, currency, percent
action: sale_order_action # Navigate to this action on click
PropertyTypeDefaultDescription
modelStringRequiredModel to query
modeString"count"Aggregation: count, sum, average, min, max
measureString-Field to aggregate (required when mode is not count)
filterString-Q-expression filter
labelString"Count"Display label
iconString"ChartBar"Lucide icon name
colorString"blue"Mantine color
formatString"number"number, currency, percent
actionString-Action identifier to navigate to on click. The KPI’s filter is passed as global_filter.

Default size: 3×3 grid units

Displays grouped data as a bar, area, line, donut or radar chart, or as a ranking.

widget: Chart
properties:
title: Monthly Revenue
model: SaleOrder
chartType: bar # bar, area, line, donut, radar, ranking
groupBy:
field: date
interval: month # day, week, month, quarter, year (for Date/Datetime fields)
mode: sum
measure: total # Required when mode != count
filter: (Q(state__in=['Confirmed','Done']))
PropertyTypeDefaultDescription
modelStringRequiredModel to query
chartTypeString"bar"bar, area, line, donut, radar, ranking
groupByObjectRequired{ field: "field_name", interval: "month" }. The interval key is optional and applies to Date/Datetime fields. Supported: day, week, month, quarter, year.
modeString"count"Aggregation: count, sum, average, min, max
measureString-Field to aggregate (required when mode is not count)
filterString-Q-expression filter
titleString-Chart title
formatString-currency or number, for the values in tooltips and on a ranking
targetNumber-bar, line and area only. Draws a dashed Target line at this value.
targetSettingString-bar, line and area only. The name of a setting (a field on Configuration) whose value is the target, read for the user’s current company each time the dashboard opens. Blank or zero draws no line. Use it instead of target whenever the number belongs to the business rather than to the module.
bandsList-bar, line and area only. Shaded value ranges, each {from, to, label, color} (label and color optional; color is a Mantine color, default gray).
limitInteger10ranking only. How many groups are listed.

Default size: 6×7 grid units (minimum height: 7)

A target or band above every value is still drawn: the value axis stretches to include it.

widget: Chart
properties:
title: Monthly Revenue
model: SaleOrder
chartType: line
groupBy: {field: date, interval: month}
mode: sum
measure: total
format: currency
target: 50000
bands:
- {from: 0, to: 30000, label: Behind, color: red}
- {from: 30000, to: 50000, label: On track, color: green}

A target is usually the customer’s own number, so a module ships the setting and points the widget at it. Sales’ Monthly Revenue chart does this with its Monthly Sales Target setting:

# models: a company-scoped setting, blank meaning "no target"
sale_monthly_target = Float(nullable=True, description="Monthly Sales Target",
company_scoped=True, groups=["sales_manager_group"])
# the widget names the setting; there is no line until someone fills it in
properties:
title: Monthly Revenue
chartType: bar
targetSetting: sale_monthly_target

Saving the view refuses a targetSetting that is not a setting (a field on Configuration from your module or one it depends on), so a typo fails at install, at upgrade and in check --only views rather than on a user’s screen. A widget that sets both target and targetSetting is refused the same way.

ranking lists one row per group, largest first: its name and value, with a bar underneath scaled to the largest. Use it for “top customers” or “top products”, where a column chart’s labels would collide. Only the largest limit groups are listed, and a line underneath counts the rest.

A bar, line or area chart with more than 20 points along its axis gets a range selector underneath, so the user can zoom into part of the series. The Chart view does the same.

A target or bands on a chart without a value axis (donut, radar, ranking), a band without numeric from and to, a band key other than those four, and a limit on anything but a ranking would all be ignored without a word, so saving the view refuses them.

Compact table widget for displaying records with formatted columns. Uses the same column spec format and formatting utilities as the CompactList form widget, but fetches its own data independently.

widget: List
properties:
title: Top Products
model: Product
limit: 5
order_by: total_sold DESC
columns:
- field: name
label: Product
bold: true
- field: total_sold
label: Sold
format: integer
align: right
- field: list_price
label: Price
format: currency
prefix: currency
color: blue
bold: true
PropertyTypeDefaultDescription
modelStringRequiredModel to query
titleString-Table title
columnsArrayRequiredColumn definitions (see below)
filterString-Q-expression filter
order_byString/Array-Sort order (e.g., "total DESC")
limitNumber5Max rows to display

Column Properties:

PropertyTypeDefaultDescription
fieldStringRequiredField name to display
labelStringField nameColumn header
formatString"text"text, currency, number, integer, percent
precisionNumberFormat defaultDecimal places
alignStringAutoleft, center, right (numbers default to right)
colorString-Mantine color for text
boldBooleanfalseBold text
prefixString-Static string or field name from the item data
suffixString-Static string or field name from the item data

Default size: 6×6 grid units (minimum height: 4)

Displays progress toward a target using a semi-circle progress indicator.

widget: Goal
properties:
model: SaleOrder
mode: count
filter: (Q(state='Done'))
target: 50
label: Monthly Sales Target
color: green
PropertyTypeDefaultDescription
modelStringRequiredModel to query
modeString"count"Aggregation: count, sum, average, min, max
measureString-Field to aggregate (required when mode is not count)
filterString-Q-expression filter
targetNumber100Goal target value
labelString"Goal"Display label
colorString"blue"Mantine color for filled segment
formatString"number"number, currency, percent
precisionNumber0Decimal places

Default size: 3×6 grid units (minimum height: 5)

Breaks a value down along a tree — sales by product category, headcount by department, stock by location — as a treemap (area is the share) or a sunburst (one ring per level). groupBy names a relation to a tree model (one that declares _parent_field); totals roll up the parent chain, so a category includes every subcategory beneath it. Each top-level branch gets its own colour, and its children inherit it.

widget: Hierarchy
properties:
title: Sales by Category
model: SaleOrderLine
groupBy: {field: product_category}
mode: sum
measure: subtotal
hierarchyStyle: treemap # treemap or sunburst
PropertyTypeDefaultDescription
modelStringRequiredModel to query
groupByObjectRequired{ field: "<relation to a tree model>" }
modeString"count"Aggregation: count, sum, average, min, max
measureString-Field to aggregate (required when mode is not count)
filterString-Q-expression filter
hierarchyStyleString"treemap"treemap or sunburst
formatString"number"number, currency, percent

Built-in welcome widget with date display. Typically spans the full width.

widget: Greeting
properties:
title: Welcome
showDate: true
showIcon: true

Personal dashboards are stored in the DashboardPreference model:

FieldTypeDescription
userManyToOne(User)Owner (auto-set to current user)
dashboard_idCharDashboard identifier (links to the view)
nameCharDisplay name (e.g., “My Sales Dashboard”)
sequenceIntegerSort order in dropdown
layoutJSONWidget positions for react-grid-layout
widgetsJSONWidget configurations (type, properties)

A RecordRule ensures users can only access their own dashboard preferences.