mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] kpi: pre-commit auto fixes
This commit is contained in:
@@ -56,8 +56,16 @@ class KPI(models.Model):
|
||||
|
||||
name = fields.Char("Name", required=True)
|
||||
description = fields.Text("Description")
|
||||
category_id = fields.Many2one("kpi.category", "Category", required=True,)
|
||||
threshold_id = fields.Many2one("kpi.threshold", "Threshold", required=True,)
|
||||
category_id = fields.Many2one(
|
||||
"kpi.category",
|
||||
"Category",
|
||||
required=True,
|
||||
)
|
||||
threshold_id = fields.Many2one(
|
||||
"kpi.threshold",
|
||||
"Threshold",
|
||||
required=True,
|
||||
)
|
||||
periodicity = fields.Integer("Periodicity", default=1)
|
||||
|
||||
periodicity_uom = fields.Selection(
|
||||
@@ -73,11 +81,21 @@ class KPI(models.Model):
|
||||
default="day",
|
||||
)
|
||||
|
||||
next_execution_date = fields.Datetime("Next execution date", readonly=True,)
|
||||
value = fields.Float(string="Value", compute="_compute_display_last_kpi_value",)
|
||||
color = fields.Text("Color", compute="_compute_display_last_kpi_value",)
|
||||
next_execution_date = fields.Datetime(
|
||||
"Next execution date",
|
||||
readonly=True,
|
||||
)
|
||||
value = fields.Float(
|
||||
string="Value",
|
||||
compute="_compute_display_last_kpi_value",
|
||||
)
|
||||
color = fields.Text(
|
||||
"Color",
|
||||
compute="_compute_display_last_kpi_value",
|
||||
)
|
||||
last_execution = fields.Datetime(
|
||||
"Last execution", compute="_compute_display_last_kpi_value",
|
||||
"Last execution",
|
||||
compute="_compute_display_last_kpi_value",
|
||||
)
|
||||
kpi_type = fields.Selection(
|
||||
[
|
||||
@@ -88,14 +106,21 @@ class KPI(models.Model):
|
||||
"KPI Computation Type",
|
||||
)
|
||||
|
||||
dbsource_id = fields.Many2one("base.external.dbsource", "External DB Source",)
|
||||
dbsource_id = fields.Many2one(
|
||||
"base.external.dbsource",
|
||||
"External DB Source",
|
||||
)
|
||||
kpi_code = fields.Text(
|
||||
"KPI Code",
|
||||
help=(
|
||||
"SQL code must return the result as 'value' " "(i.e. 'SELECT 5 AS value')."
|
||||
),
|
||||
)
|
||||
history_ids = fields.One2many("kpi.history", "kpi_id", "History",)
|
||||
history_ids = fields.One2many(
|
||||
"kpi.history",
|
||||
"kpi_id",
|
||||
"History",
|
||||
)
|
||||
active = fields.Boolean(
|
||||
"Active",
|
||||
help=(
|
||||
|
||||
@@ -11,7 +11,12 @@ class KPIHistory(models.Model):
|
||||
_description = "History of the KPI"
|
||||
_order = "date desc"
|
||||
|
||||
name = fields.Char("Name", size=150, required=True, default=fields.Datetime.now(),)
|
||||
name = fields.Char(
|
||||
"Name",
|
||||
size=150,
|
||||
required=True,
|
||||
default=fields.Datetime.now(),
|
||||
)
|
||||
kpi_id = fields.Many2one("kpi", "KPI", required=True)
|
||||
date = fields.Datetime(
|
||||
"Execution Date",
|
||||
|
||||
@@ -73,7 +73,8 @@ class KPIThresholdRange(models.Model):
|
||||
min_code = fields.Text("Minimum Computation Code")
|
||||
min_error = fields.Char("Minimum Error", compute="_compute_min_value")
|
||||
min_dbsource_id = fields.Many2one(
|
||||
"base.external.dbsource", "External DB Source Minimum",
|
||||
"base.external.dbsource",
|
||||
"External DB Source Minimum",
|
||||
)
|
||||
max_type = fields.Selection(
|
||||
selection="_selection_value_type", string="Max Type", required=True
|
||||
@@ -83,7 +84,8 @@ class KPIThresholdRange(models.Model):
|
||||
max_code = fields.Text("Maximum Computation Code")
|
||||
max_error = fields.Char("Maximum Error", compute="_compute_max_value")
|
||||
max_dbsource_id = fields.Many2one(
|
||||
"base.external.dbsource", "External DB Source Maximum",
|
||||
"base.external.dbsource",
|
||||
"External DB Source Maximum",
|
||||
)
|
||||
|
||||
color = fields.Char(string="Color", help="Choose your color")
|
||||
|
||||
Reference in New Issue
Block a user