---
title: "Dashboards"
description: "Raportit ja kaaviot. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop.dev/fi/apps/dashboards/"
lang: "fi"
---

# Dashboards

## Mihin se on tarkoitettu

Store dashboards and widgets as data (KPI, bar, line, pie and table definitions) for a client to render. The package never runs a query and does not check that the models it names exist.

## Mitä paketti tekee ja mitä ei

Dashboards and their widgets stored as data, for a UI to render. A dashboard has a title and an owner. A widget describes one tile with these fields: kind (kpi, bar, line, pie or table), model_name (the model to read, for example sale_order), measure_field (the field to aggregate; empty for count), aggregate (count or sum; sum needs a number or money measure_field), group_by (field to split by, for bar, line, pie and table; empty for a single kpi value), filter (a JSON object of field names to exact values, for example {"state":"paid"}; empty means all records) and position (order on the dashboard, lowest first). The package only stores the definition; it does not check that the model or fields exist and it computes nothing.

## Mallit

### `dashboards_dashboard`

A dashboard: a titled, ordered collection of widgets

Lukuryhmä: `dashboards.user`. Kirjoitusryhmä: `dashboards.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `title` | text | `none` | ei | `dashboards.user` | selkoisena | Dashboard title, for example Sales overview |
| `owner` | text | `internal` | kyllä | `dashboards.user` | maskattu | Name of the person who owns the dashboard |
| `description` | longtext | `none` | ei | `dashboards.user` | selkoisena | What the dashboard shows and for whom |
| `shared` | bool | `none` | ei | `dashboards.user` | selkoisena | Whether everyone with access to the Dashboards app sees it, or only the owner |
| `position` | number | `none` | ei | `dashboards.user` | selkoisena | Order among dashboards, lowest first |

### `dashboards_widget`

One tile on a dashboard, defined by what to read and how to aggregate it

Lukuryhmä: `dashboards.user`. Kirjoitusryhmä: `dashboards.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `dashboard_id` | ref → dashboards_dashboard | `none` | ei | `dashboards.user` | selkoisena | The dashboard the widget is on |
| `title` | text | `none` | ei | `dashboards.user` | selkoisena | Tile title, for example Paid orders |
| `kind` | select (kpi, bar, line, pie, table) | `none` | ei | `dashboards.user` | selkoisena | How the tile is drawn: kpi, bar, line, pie, table |
| `model_name` | text | `none` | ei | `dashboards.user` | selkoisena | Model the tile reads, for example sale_order |
| `measure_field` | text | `none` | ei | `dashboards.user` | selkoisena | Field to aggregate: a number or money field of the model; empty when counting |
| `aggregate` | select (count, sum) | `none` | ei | `dashboards.user` | selkoisena | How records are combined: count or sum |
| `group_by` | text | `none` | ei | `dashboards.user` | selkoisena | Field to split the result by (a select, ref or date field); empty for one value |
| `filter` | longtext | `none` | ei | `dashboards.user` | selkoisena | JSON object of field names to exact values that records must match, for example {"state":"paid"}; empty means all records |
| `position` | number | `none` | ei | `dashboards.user` | selkoisena | Order of the tile on the dashboard, lowest first |

## Työnkulut

Tässä sovelluksessa ei ole työnkulun toimintoja; tietueet luodaan ja muokataan suoraan.

## Käyttöoikeusryhmät

Tämän sovelluksen käyttämät ryhmät:

- `dashboards.manager`
- `dashboards.user`

## Hyväksyntävaiheet

Mikään tämän sovelluksen vaihe ei vaadi hyväksyntää tietueiden poistamista lukuun ottamatta.

## Mitä agentit voivat ja eivät voi tehdä

Agentti voi lukea, hakea, luoda ja päivittää tämän sovelluksen tietueita sekä suorittaa toiminnot, jotka eivät vaadi hyväksyntää, tunnisteensa käyttöoikeusryhmien rajoissa.

Se voi vain ehdottaa näitä vaiheita, ja ihmisen on hyväksyttävä ne: `dashboards_dashboard.delete`, `dashboards_widget.delete`.

Henkilötiedot maskataan paikkamerkeiksi: `dashboards_dashboard.owner`.

## Riippuvuudet

Ei ole.

## Asennus

Asenna se Customize-sovelluksesta (Marketplace) tai komentoriviltä:

```bash
obop modules install-from dashboards
```

Vaatii tietokannan ja ylläpitäjän oikeudet.

## Tee oma

[Moduulioppaassa näytetään, miten tällaiset sovellukset kirjoitetaan](/fi/docs/reference/module-manifest/)
