mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[12.0][IMP] kpi_dashboard: Add demo data and testing
This commit is contained in:
@@ -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
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user