diff --git a/kpi/README.rst b/kpi/README.rst index b1ba9374e..94a975968 100644 --- a/kpi/README.rst +++ b/kpi/README.rst @@ -17,32 +17,32 @@ Key Performance Indicator :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github - :target: https://github.com/OCA/reporting-engine/tree/13.0/kpi + :target: https://github.com/OCA/reporting-engine/tree/17.0/kpi :alt: OCA/reporting-engine .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-kpi + :target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-kpi :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=13.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| 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. +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. +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) +- 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) **Table of contents** @@ -52,8 +52,7 @@ A threshold is a list of ranges and a range is: Usage ===== -Example of usage: -https://www.youtube.com/watch?v=OC4-y2klzIk +Example of usage: https://www.youtube.com/watch?v=OC4-y2klzIk Bug Tracker =========== @@ -61,7 +60,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -69,26 +68,26 @@ Credits ======= Authors -~~~~~~~ +------- * Savoir-faire Linux Contributors -~~~~~~~~~~~~ +------------ -* Daniel Reis -* Glen Dromgoole -* Loic Lacroix -* Sandy Carter -* Gervais Naoussi -* Iván Todorovich -* Adrià Gil -* `Guadaltech `_: +- Daniel Reis +- Glen Dromgoole +- Loic Lacroix +- Sandy Carter +- Gervais Naoussi +- Iván Todorovich +- Adrià Gil +- `Guadaltech `__: - * Fernando La Chica + - Fernando La Chica Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -100,6 +99,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/reporting-engine `_ project on GitHub. +This module is part of the `OCA/reporting-engine `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/kpi/models/kpi.py b/kpi/models/kpi.py index 4a856312a..6b1f9312f 100644 --- a/kpi/models/kpi.py +++ b/kpi/models/kpi.py @@ -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=( diff --git a/kpi/models/kpi_history.py b/kpi/models/kpi_history.py index e129117e2..344d0c09c 100644 --- a/kpi/models/kpi_history.py +++ b/kpi/models/kpi_history.py @@ -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", diff --git a/kpi/models/kpi_threshold_range.py b/kpi/models/kpi_threshold_range.py index d7aae7ffd..434c4d489 100644 --- a/kpi/models/kpi_threshold_range.py +++ b/kpi/models/kpi_threshold_range.py @@ -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") diff --git a/kpi/pyproject.toml b/kpi/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/kpi/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/kpi/readme/CONTRIBUTORS.md b/kpi/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..5c1a989fb --- /dev/null +++ b/kpi/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- Daniel Reis \<\> +- Glen Dromgoole \<\> +- Loic Lacroix \<\> +- Sandy Carter \<\> +- Gervais Naoussi \<\> +- Iván Todorovich \<\> +- Adrià Gil \<\> +- [Guadaltech](https://www.guadaltech.es): + - Fernando La Chica \<\> diff --git a/kpi/readme/CONTRIBUTORS.rst b/kpi/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5d339513f..000000000 --- a/kpi/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,10 +0,0 @@ -* Daniel Reis -* Glen Dromgoole -* Loic Lacroix -* Sandy Carter -* Gervais Naoussi -* Iván Todorovich -* Adrià Gil -* `Guadaltech `_: - - * Fernando La Chica diff --git a/kpi/readme/DESCRIPTION.md b/kpi/readme/DESCRIPTION.md new file mode 100644 index 000000000..886c78862 --- /dev/null +++ b/kpi/readme/DESCRIPTION.md @@ -0,0 +1,15 @@ +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) diff --git a/kpi/readme/DESCRIPTION.rst b/kpi/readme/DESCRIPTION.rst deleted file mode 100644 index e98040be7..000000000 --- a/kpi/readme/DESCRIPTION.rst +++ /dev/null @@ -1,15 +0,0 @@ -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) diff --git a/kpi/readme/USAGE.md b/kpi/readme/USAGE.md new file mode 100644 index 000000000..ff034a448 --- /dev/null +++ b/kpi/readme/USAGE.md @@ -0,0 +1 @@ +Example of usage: diff --git a/kpi/readme/USAGE.rst b/kpi/readme/USAGE.rst deleted file mode 100644 index 8306397cd..000000000 --- a/kpi/readme/USAGE.rst +++ /dev/null @@ -1,2 +0,0 @@ -Example of usage: -https://www.youtube.com/watch?v=OC4-y2klzIk diff --git a/kpi/static/description/index.html b/kpi/static/description/index.html index fa3f774dd..033b8d1d9 100644 --- a/kpi/static/description/index.html +++ b/kpi/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,20 +369,20 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:cfa60f307c1347dd86421388daf4ddf0cef49cfe864c034368a4b031d2dc045c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

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.

+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)
  • +
  • color (RGB code like #00FF00 for green, #FFA500 for orange, #FF0000 +for red)

Table of contents

@@ -399,15 +399,14 @@ manually.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -437,11 +436,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/reporting-engine project on GitHub.

+

This module is part of the OCA/reporting-engine project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.