[12.0][IMP] kpi_dashboard: Add demo data and testing

This commit is contained in:
Enric Tobella
2020-04-28 18:01:19 +02:00
parent 3ca213d3e0
commit 85595af9a8
7 changed files with 368 additions and 13 deletions

View File

@@ -11,6 +11,17 @@ Configure KPIs
#. In order to compute the KPI you can use a predefined function from a model or
use the code to directly compute it.
Using KPI with code
~~~~~~~~~~~~~~~~~~~
Define the code directly on the code field. You can use `self` and `model` as the kpi element
The script should create a variable called `result` as a dictionary that
will be stored as the value.
For example, we can use::
result = {}
result['value'] = len(model.search([('id', '=', %s)]))
result['previous'] = len(model.search([('id', '!=', %s)]))
Configure dashboards
~~~~~~~~~~~~~~~~~~~~