Repository
OCA/reporting-engine · module folder · Try on Runboat
Module version
1.0.0
Category
Report
Folder size
1.43 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/reporting-engine
Last tracking update
2026-08-07 09:06:34
Authors
Savoir-faire Linux, Odoo Community Association (OCA), Gray Matter Logic
Maintainers
Savoir-faire Linux, Odoo Community Association (OCA), Gray Matter Logic
Committers
Maxime Chambreuil, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
mgmtsystem_kpi
Description
This module provides the basis for creating key performance indicators,
including static and dynamic thresholds (SQL query or Python code), on
local and remote data sources.

The module also provides the mecanism to update KPIs automatically. A
scheduler is executed every hour and updates the KPI values, based on
the periodicity of each KPI. KPI computation can also be done manually.

A threshold is a list of ranges and a range is:

- a name (like Good, Warning, Bad)
- a minimum value (fixed, sql query or python code)
- a maximum value (fixed, sql query or python code)
- color (RGB code like \#00FF00 for green, \#FFA500 for orange, \#FF0000
  for red)

Code Analysis

Views touched (12)
XML IDNameModelTypeStatus
view_kpi_category_form kpi.category.form kpi.category form New
view_kpi_category_tree kpi.category.tree kpi.category list New
view_kpi_filter kpi.filter kpi search New
view_kpi_form kpi.form kpi form New
view_kpi_history_form kpi.history.form kpi.history form New
view_kpi_history_tree kpi.history.tree kpi.history list New
view_kpi_kanban kpi.kanban kpi kanban New
view_kpi_threshold_form kpi.threshold.form kpi.threshold form New
view_kpi_threshold_range_form kpi.threshold.range.form kpi.threshold.range form New
view_kpi_threshold_range_tree kpi.threshold.range.tree kpi.threshold.range list New
view_kpi_threshold_tree kpi.threshold.tree kpi.threshold list New
view_kpi_tree kpi.tree kpi list New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (5)

New fields (16)
  • active Boolean
    default=True help='Only active KPIs will be updated by the scheduler based on the periodicity configuration.'
  • category_id Many2one → kpi.category
    required=True args: 'kpi.category', 'Category'
  • color Text
    compute='_compute_display_last_kpi_value'
  • company_id Many2one → res.company
    default=<expr> args: 'res.company', 'Company'
  • dbsource_id Many2one → base.external.dbsource
    args: 'base.external.dbsource', 'External DB Source'
  • description Text
  • history_ids One2many → kpi.history
    args: 'kpi.history', 'kpi_id', 'History'
  • kpi_code Text
    help="SQL code must return the result as 'value' (i.e. 'SELECT 5 AS value')." args: 'KPI Code'
  • kpi_type Selection
    args: [('python', 'Python'), ('local', 'SQL - Local DB'), ('external', 'SQL - External DB')], 'KPI Computation Type'
  • last_execution Datetime
    compute='_compute_display_last_kpi_value' args: 'Last execution'
  • name Char
    required=True
  • next_execution_date Datetime
    args: 'Next execution date'
  • periodicity Integer
    default=1
  • periodicity_uom Selection
    default='day' required=True args: [('minute', 'Minute'), ('hour', 'Hour'), ('day', 'Day'), ('week', 'Week'), ('month', 'Month')], 'Periodicity UoM'
  • threshold_id Many2one → kpi.threshold
    required=True args: 'kpi.threshold', 'Threshold'
  • value Float
    compute='_compute_display_last_kpi_value'
Public methods (3)
  • compute_kpi_value(self)
  • update_kpi_value(self)
    @api.model
  • update_next_execution_date(self)

New fields (2)
  • description Text
  • name Char
    required=True
Public methods (0)

No public methods.

New fields (6)
  • color Text
    default='#FFFFFF' readonly=True required=True
  • company_id Many2one → res.company
    default=<expr> args: 'res.company', 'Company'
  • date Datetime
    default=<expr> readonly=True required=True args: 'Execution Date'
  • kpi_id Many2one → kpi
    required=True args: 'kpi', 'KPI'
  • name Char
    default=fields.Datetime.now() required=True size=150
  • value Float
    readonly=True required=True
Public methods (0)

No public methods.

New fields (6)
  • company_id Many2one → res.company
    default=<expr> args: 'res.company', 'Company'
  • invalid_message Char
    compute='_compute_is_valid_threshold' size=100 string='Message'
  • kpi_ids One2many → kpi
    args: 'kpi', 'threshold_id', 'KPIs'
  • name Char
    required=True
  • range_ids Many2many → kpi.threshold.range
    args: 'kpi.threshold.range', 'kpi_threshold_range_rel', 'threshold_id', 'range_id', 'Ranges'
  • valid Boolean
    compute='_compute_is_valid_threshold' default=True required=True
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • get_color(self, kpi_value)

New fields (18)
  • color Char
    help='Choose your color'
  • company_id Many2one → res.company
    default=<expr> args: 'res.company', 'Company'
  • invalid_message Char
    compute='_compute_is_valid_range' size=100 string='Message'
  • max_code Text
    args: 'Maximum Computation Code'
  • max_dbsource_id Many2one → base.external.dbsource
    args: 'base.external.dbsource', 'External DB Source Maximum'
  • max_error Char
    compute='_compute_max_value' args: 'Maximum Error'
  • max_fixed_value Float
    args: 'Maximum Fixed Value'
  • max_type Selection
    required=True selection='_selection_value_type'
  • max_value Float
    compute='_compute_max_value' string='Maximum Value'
  • min_code Text
    args: 'Minimum Computation Code'
  • min_dbsource_id Many2one → base.external.dbsource
    args: 'base.external.dbsource', 'External DB Source Minimum'
  • min_error Char
    compute='_compute_min_value' args: 'Minimum Error'
  • min_fixed_value Float
    args: 'Minimum Fixed Value'
  • min_type Selection
    required=True selection='_selection_value_type'
  • min_value Float
    compute='_compute_min_value' string='Minimum Value'
  • name Char
    required=True
  • threshold_ids Many2many → kpi.threshold
    args: 'kpi.threshold', 'kpi_threshold_range_rel', 'range_id', 'threshold_id', 'Thresholds'
  • valid Boolean
    compute='_compute_is_valid_range' default=True required=True
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…