diff --git a/kpi_dashboard/README.rst b/kpi_dashboard/README.rst index a8dc09cf3..7312871e2 100644 --- a/kpi_dashboard/README.rst +++ b/kpi_dashboard/README.rst @@ -14,13 +14,13 @@ Kpi Dashboard :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/12.0/kpi_dashboard + :target: https://github.com/OCA/reporting-engine/tree/14.0/kpi_dashboard :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-12-0/reporting-engine-12-0-kpi_dashboard + :target: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-kpi_dashboard :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/143/12.0 + :target: https://runbot.odoo-community.org/runbot/143/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -75,7 +75,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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -113,6 +113,6 @@ Current `maintainer `__: |maintainer-etobella| -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_dashboard/__manifest__.py b/kpi_dashboard/__manifest__.py index 9dc410d2e..9f7567af5 100644 --- a/kpi_dashboard/__manifest__.py +++ b/kpi_dashboard/__manifest__.py @@ -5,7 +5,7 @@ "name": "Kpi Dashboard", "summary": """ Create Dashboards using kpis""", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "license": "AGPL-3", "author": "Creu Blanca,Odoo Community Association (OCA)", "website": "https://github.com/OCA/reporting-engine", diff --git a/kpi_dashboard/demo/demo_dashboard.xml b/kpi_dashboard/demo/demo_dashboard.xml index 83aa515ac..7b04070a9 100644 --- a/kpi_dashboard/demo/demo_dashboard.xml +++ b/kpi_dashboard/demo/demo_dashboard.xml @@ -13,18 +13,14 @@ $ code number - -result = {"value": 10000,"previous": 12000} - + result = {"value": 10000,"previous": 12000} Number 02 code number - -result = {"value": 12000,"previous": 10000} - + result = {"value": 12000,"previous": 10000} code meter - -result = {"min": 0, "max": 100, "value": 90} - + result = {"min": 0, "max": 100, "value": 90} Meter 02 $ code meter - -result = {"min": 0, "max": 100, "value": 40} - + result = {"min": 0, "max": 100, "value": 40} Graph code graph - + + ]]> @@ -89,18 +83,22 @@ result = {"graphs": [ code integer - + + ]]> Counter code counter - + + ]]> Dashboard title @@ -161,13 +159,13 @@ result = {"value": self.env.context.get('counter', 990)} #B41F1F #EEBF77 - {'counter': (context.counter or 990) + 1} + + {'counter': (context.counter or 990) + 1} + - check_if(((context.counter or 990) + 1) % 2, '#ff0000', '#00ff00') + + check_if(((context.counter or 990) + 1) % 2, '#ff0000', '#00ff00') + Counter diff --git a/kpi_dashboard/i18n/kpi_dashboard.pot b/kpi_dashboard/i18n/kpi_dashboard.pot index d58668050..561120e7b 100644 --- a/kpi_dashboard/i18n/kpi_dashboard.pot +++ b/kpi_dashboard/i18n/kpi_dashboard.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * kpi_dashboard +# * kpi_dashboard # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,14 +14,14 @@ msgstr "" "Plural-Forms: \n" #. module: kpi_dashboard -#: code:addons/kpi_dashboard/models/kpi_kpi.py:153 +#: code:addons/kpi_dashboard/models/kpi_kpi.py:0 #, python-format msgid " or " msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:72 +#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:0 #, python-format msgid "'%s' added to dashboard" msgstr "" @@ -53,24 +53,13 @@ msgstr "" msgid "Active" msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Activity" -msgstr "" - #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:72 +#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:0 #, python-format msgid "Add to Dashboard" msgstr "" -#. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 -msgid "Altair" -msgstr "" - #. module: kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi__args msgid "Args" @@ -81,17 +70,6 @@ msgstr "" msgid "Background Color" msgstr "" -#. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 -msgid "Bokeh" -msgstr "" - -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Calendar" -msgstr "" - #. module: kpi_dashboard #: model_terms:ir.ui.view,arch_db:kpi_dashboard.kpi_dashboard_item_config_form_view #: model_terms:ir.ui.view,arch_db:kpi_dashboard.kpi_dashboard_menu_form_view @@ -100,8 +78,8 @@ msgstr "" #. module: kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi__code +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__computation_method__code #: model_terms:ir.ui.view,arch_db:kpi_dashboard.kpi_kpi_form_view -#: selection:kpi.kpi,computation_method:0 msgid "Code" msgstr "" @@ -162,13 +140,13 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:76 +#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:0 #, python-format msgid "Could not add KPI dashboard to dashboard" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__widget__counter msgid "Counter" msgstr "" @@ -204,12 +182,12 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/js/dashboard_view.js:21 -#: selection:ir.actions.act_window.view,view_mode:0 +#: code:addons/kpi_dashboard/static/src/js/dashboard_view.js:0 #: model:ir.model,name:kpi_dashboard.model_kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_item__dashboard_id #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_menu__dashboard_id -#: selection:ir.ui.view,type:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__ir_actions_act_window_view__view_mode__dashboard +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__ir_ui_view__type__dashboard #, python-format msgid "Dashboard" msgstr "" @@ -225,11 +203,8 @@ msgid "Dashboard Items" msgstr "" #. module: kpi_dashboard -#: selection:ir.ui.view,type:0 -msgid "Diagram" -msgstr "" - -#. module: kpi_dashboard +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_actions_act_window_view__display_name +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_ui_view__display_name #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard__display_name #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_item__display_name #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_menu__display_name @@ -256,7 +231,7 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:57 +#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:0 #, python-format msgid "First you must create the Menu" msgstr "" @@ -266,24 +241,12 @@ msgstr "" msgid "Font Color" msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Form" -msgstr "" - #. module: kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi__function -#: selection:kpi.kpi,computation_method:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__computation_method__function msgid "Function" msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Gantt" -msgstr "" - #. module: kpi_dashboard #: model_terms:ir.ui.view,arch_db:kpi_dashboard.kpi_dashboard_menu_form_view msgid "Generate" @@ -306,15 +269,13 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:25 +#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:0 #, python-format msgid "Go to" msgstr "" #. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -#: selection:kpi.kpi,widget:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__widget__graph msgid "Graph" msgstr "" @@ -334,6 +295,8 @@ msgid "History" msgstr "" #. module: kpi_dashboard +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_actions_act_window_view__id +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_ui_view__id #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard__id #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_item__id #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_menu__id @@ -344,7 +307,7 @@ msgid "ID" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__widget__integer msgid "Integer" msgstr "" @@ -373,12 +336,6 @@ msgstr "" msgid "KPIs" msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Kanban" -msgstr "" - #. module: kpi_dashboard #: model:ir.actions.act_window,name:kpi_dashboard.kpi_kpi_act_window #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_item__kpi_id @@ -413,6 +370,8 @@ msgid "Kwargs" msgstr "" #. module: kpi_dashboard +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_actions_act_window_view____last_update +#: model:ir.model.fields,field_description:kpi_dashboard.field_ir_ui_view____last_update #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard____last_update #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_item____last_update #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_dashboard_menu____last_update @@ -444,7 +403,7 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:70 +#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:0 #, python-format msgid "Main actions" msgstr "" @@ -471,7 +430,7 @@ msgid "Menu" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__widget__meter msgid "Meter" msgstr "" @@ -509,7 +468,7 @@ msgid "Name" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi,widget:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi__widget__number msgid "Number" msgstr "" @@ -518,15 +477,9 @@ msgstr "" msgid "Number Of Columns" msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Pivot" -msgstr "" - #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:73 +#: code:addons/kpi_dashboard/static/src/js/dashboard_controller.js:0 #, python-format msgid "Please refresh your browser for the changes to take effect." msgstr "" @@ -536,11 +489,6 @@ msgstr "" msgid "Prefix" msgstr "" -#. module: kpi_dashboard -#: selection:ir.ui.view,type:0 -msgid "QWeb" -msgstr "" - #. module: kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi_history__raw_value msgid "Raw Value" @@ -561,11 +509,6 @@ msgstr "" msgid "Save" msgstr "" -#. module: kpi_dashboard -#: selection:ir.ui.view,type:0 -msgid "Search" -msgstr "" - #. module: kpi_dashboard #: model:ir.model.fields,help:kpi_dashboard.field_kpi_dashboard__compute_on_fly_refresh msgid "Seconds to refresh on fly elements" @@ -573,7 +516,8 @@ msgstr "" #. module: kpi_dashboard #. openerp-web -#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:34 +#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:0 +#: code:addons/kpi_dashboard/static/src/xml/dashboard.xml:0 #, python-format msgid "Selection" msgstr "" @@ -600,7 +544,7 @@ msgid "Size Y" msgstr "" #. module: kpi_dashboard -#: code:addons/kpi_dashboard/models/kpi_dashboard.py:139 +#: code:addons/kpi_dashboard/models/kpi_dashboard.py:0 #, python-format msgid "Size Y of the widget cannot be bigger than 10" msgstr "" @@ -626,17 +570,11 @@ msgid "Suffix" msgstr "" #. module: kpi_dashboard -#: code:addons/kpi_dashboard/models/kpi_kpi.py:155 +#: code:addons/kpi_dashboard/models/kpi_kpi.py:0 #, python-format msgid "The code cannot contain the following terms: %s." msgstr "" -#. module: kpi_dashboard -#: selection:ir.actions.act_window.view,view_mode:0 -#: selection:ir.ui.view,type:0 -msgid "Tree" -msgstr "" - #. module: kpi_dashboard #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi__value #: model:ir.model.fields,field_description:kpi_dashboard.field_kpi_kpi_history__value @@ -666,7 +604,7 @@ msgid "Widget" msgstr "" #. module: kpi_dashboard -#: code:addons/kpi_dashboard/models/kpi_dashboard.py:160 +#: code:addons/kpi_dashboard/models/kpi_dashboard.py:0 #, python-format msgid "Widget %s is bigger than expected" msgstr "" @@ -687,7 +625,7 @@ msgid "Widget configuration" msgstr "" #. module: kpi_dashboard -#: code:addons/kpi_dashboard/models/kpi_dashboard.py:156 +#: code:addons/kpi_dashboard/models/kpi_dashboard.py:0 #, python-format msgid "Widgets cannot be crossed by other widgets" msgstr "" @@ -698,27 +636,26 @@ msgid "Width" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi.action,action:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi_action__action__ir_actions_act_url msgid "ir.actions.act_url" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi.action,action:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi_action__action__ir_actions_act_window msgid "ir.actions.act_window" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi.action,action:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi_action__action__ir_actions_client msgid "ir.actions.client" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi.action,action:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi_action__action__ir_actions_report msgid "ir.actions.report" msgstr "" #. module: kpi_dashboard -#: selection:kpi.kpi.action,action:0 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__kpi_kpi_action__action__ir_actions_server msgid "ir.actions.server" msgstr "" - diff --git a/kpi_dashboard/models/ir_actions_act_window_view.py b/kpi_dashboard/models/ir_actions_act_window_view.py index ad2a2a8c0..c0e96fc71 100644 --- a/kpi_dashboard/models/ir_actions_act_window_view.py +++ b/kpi_dashboard/models/ir_actions_act_window_view.py @@ -7,4 +7,6 @@ from odoo import fields, models class IrActionsActWindowView(models.Model): _inherit = "ir.actions.act_window.view" - view_mode = fields.Selection(selection_add=[("dashboard", "Dashboard")]) + view_mode = fields.Selection( + selection_add=[("dashboard", "Dashboard")], ondelete={"dashboard": "cascade"} + ) diff --git a/kpi_dashboard/models/ir_ui_view.py b/kpi_dashboard/models/ir_ui_view.py index 6c4e32738..f0d8fdb5f 100644 --- a/kpi_dashboard/models/ir_ui_view.py +++ b/kpi_dashboard/models/ir_ui_view.py @@ -7,4 +7,6 @@ from odoo import fields, models class IrUiView(models.Model): _inherit = "ir.ui.view" - type = fields.Selection(selection_add=[("dashboard", "Dashboard")]) + type = fields.Selection( + selection_add=[("dashboard", "Dashboard")], ondelete={"dashboard": "cascade"} + ) diff --git a/kpi_dashboard/models/kpi_dashboard.py b/kpi_dashboard/models/kpi_dashboard.py index c03073ab8..20642ed39 100644 --- a/kpi_dashboard/models/kpi_dashboard.py +++ b/kpi_dashboard/models/kpi_dashboard.py @@ -11,9 +11,13 @@ class KpiDashboard(models.Model): _description = "Dashboard" name = fields.Char(required=True) - active = fields.Boolean(default=True,) + active = fields.Boolean( + default=True, + ) item_ids = fields.One2many( - "kpi.dashboard.item", inverse_name="dashboard_id", copy=True, + "kpi.dashboard.item", + inverse_name="dashboard_id", + copy=True, ) number_of_columns = fields.Integer(default=5, required=True) compute_on_fly_refresh = fields.Integer( @@ -25,7 +29,9 @@ class KpiDashboard(models.Model): widget_dimension_x = fields.Integer(default=250, required=True) widget_dimension_y = fields.Integer(default=250, required=True) background_color = fields.Char(required=True, default="#f9f9f9") - group_ids = fields.Many2many("res.groups",) + group_ids = fields.Many2many( + "res.groups", + ) menu_id = fields.Many2one("ir.ui.menu", copy=False) def write(self, vals): @@ -227,3 +233,6 @@ class KpiDashboardItem(models.Model): "kpi_dashboard.kpi_dashboard_item_config_form_view" ).id, } + + def store_data(self): + return {"type": "ir.actions.act_window_close"} diff --git a/kpi_dashboard/models/kpi_kpi.py b/kpi_dashboard/models/kpi_kpi.py index 90d340b43..12c72d52e 100644 --- a/kpi_dashboard/models/kpi_kpi.py +++ b/kpi_dashboard/models/kpi_kpi.py @@ -2,9 +2,9 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import ast -import datetime import json import re +from datetime import date, datetime, time from dateutil import relativedelta @@ -24,11 +24,15 @@ class KpiKpi(models.Model): active = fields.Boolean(default=True) cron_id = fields.Many2one("ir.cron", readonly=True, copy=False) computation_method = fields.Selection( - [("function", "Function"), ("code", "Code")], required=True + [("function", "Function"), ("code", "Code")], + required=True, + default="code", ) value = fields.Serialized() dashboard_item_ids = fields.One2many("kpi.dashboard.item", inverse_name="kpi_id") - model_id = fields.Many2one("ir.model",) + model_id = fields.Many2one( + "ir.model", + ) function = fields.Char() args = fields.Char() kwargs = fields.Char() @@ -144,6 +148,8 @@ class KpiKpi(models.Model): "self": self, "model": self.browse(), "datetime": datetime, + "date": date, + "time": time, "float_compare": float_compare, "relativedelta": relativedelta.relativedelta, } @@ -231,6 +237,7 @@ class KpiKpiHistory(models.Model): widget = fields.Selection( selection=lambda self: self.env["kpi.kpi"]._fields["widget"].selection, required=True, + default="number", ) @api.depends("value") diff --git a/kpi_dashboard/security/ir.model.access.csv b/kpi_dashboard/security/ir.model.access.csv index 8dacb37ef..51698bc7e 100644 --- a/kpi_dashboard/security/ir.model.access.csv +++ b/kpi_dashboard/security/ir.model.access.csv @@ -9,3 +9,4 @@ manage_kpi_dashboard_kpi,manage_kpi_dashboard_kpi,model_kpi_dashboard_item,group manage_kpi_kpi,manage_kpi_kpi,model_kpi_kpi,group_kpi_dashboard_manager,1,1,1,1 manage_kpi_kpi_action,manage_kpi_kpi_action,model_kpi_kpi_action,group_kpi_dashboard_manager,1,1,1,1 manage_kpi_kpi_history,manage_kpi_kpi_history,model_kpi_kpi_history,group_kpi_dashboard_manager,1,1,1,1 +access_kpi_dashboard_menu,access_kpi_dashboard_menu,model_kpi_dashboard_menu,group_kpi_dashboard_manager,1,1,1,1 diff --git a/kpi_dashboard/security/security.xml b/kpi_dashboard/security/security.xml index dd87e7c2d..4ed1d841c 100644 --- a/kpi_dashboard/security/security.xml +++ b/kpi_dashboard/security/security.xml @@ -9,9 +9,10 @@ KPI Dashboard: User - ['|', ('group_ids', '=', False), ('group_ids', 'in', user.groups_id.ids)] + + ['|', ('group_ids', '=', False), ('group_ids', 'in', + user.groups_id.ids)] + diff --git a/kpi_dashboard/static/description/index.html b/kpi_dashboard/static/description/index.html index 09f8b1f9d..3dfe1c475 100644 --- a/kpi_dashboard/static/description/index.html +++ b/kpi_dashboard/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module adds new kinds of dashboards on a specific new type of view.

Table of contents

@@ -431,7 +431,7 @@ result['previous'] = len(model.search([('id', '!=', %s)]))

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 smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -457,7 +457,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

etobella

-

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_dashboard/static/src/js/dashboard_controller.js b/kpi_dashboard/static/src/js/dashboard_controller.js index bf6e5554e..e433bd077 100644 --- a/kpi_dashboard/static/src/js/dashboard_controller.js +++ b/kpi_dashboard/static/src/js/dashboard_controller.js @@ -1,7 +1,7 @@ /* global py */ -odoo.define("kpi_dashboard.DashboardController", function(require) { +odoo.define("kpi_dashboard.DashboardController", function (require) { "use strict"; var BasicController = require("web.BasicController"); @@ -11,7 +11,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { var _t = core._t; var DashboardController = BasicController.extend({ - init: function() { + init: function () { this._super.apply(this, arguments); this.dashboard_context = {}; this.dashboard_color_data = []; @@ -23,15 +23,15 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { add_modify_color: "_addModifyColor", refresh_colors: "_refreshColors", }), - _refreshOnFly: function() { + _refreshOnFly: function () { var self = this; this._rpc({ model: this.modelName, method: "read_dashboard_on_fly", args: [[this.renderer.state.res_id]], context: this._getContext(), - }).then(function(data) { - _.each(data, function(item) { + }).then(function (data) { + _.each(data, function (item) { // We will follow the same logic used on Bus Notifications self.renderer._onNotification([ ["kpi_dashboard_" + self.renderer.state.res_id, item], @@ -39,21 +39,21 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { }); }); }, - renderPager: function($node, options) { + renderPager: function ($node, options) { // eslint-disable-next-line no-param-reassign options = _.extend({}, options, { validate: this.canBeDiscarded.bind(this), }); this._super($node, options); }, - _pushState: function(state) { + _pushState: function (state) { // eslint-disable-next-line no-param-reassign state = state || {}; var env = this.model.get(this.handle, {env: true}); state.id = env.currentId; this._super(state); }, - _addDashboard: function() { + _addDashboard: function () { var self = this; var action = self.initialState.specialData.action_id; var name = self.initialState.specialData.name; @@ -71,7 +71,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { name: name, }, }) - .then(function(r) { + .then(function (r) { if (r) { self.do_notify( _.str.sprintf(_t("'%s' added to dashboard"), name), @@ -84,7 +84,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { } }); }, - _updateButtons: function() { + _updateButtons: function () { // HOOK Function this.$buttons.on( "click", @@ -92,7 +92,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { this._addDashboard.bind(this) ); }, - renderButtons: function($node) { + renderButtons: function ($node) { if (!$node) { return; } @@ -103,7 +103,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { this._updateButtons(); this.$buttons.appendTo($node); }, - _getContext: function() { + _getContext: function () { return _.extend( {}, this.model.get(this.handle, {raw: true}).getContext(), @@ -111,7 +111,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { this.dashboard_context ); }, - _modifyContext: function(event) { + _modifyContext: function (event) { var ctx = this._getContext(); this.dashboard_context = _.extend( this.dashboard_context, @@ -119,7 +119,7 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { context: _.extend( ctx, { - __getattr__: function() { + __getattr__: function () { return false; }, } @@ -131,23 +131,23 @@ odoo.define("kpi_dashboard.DashboardController", function(require) { this._refreshOnFly(event); this._refreshColors(); }, - _addModifyColor: function(event) { + _addModifyColor: function (event) { this.dashboard_color_data.push([ event.data.element_id, event.data.expression, ]); }, - _refreshColors: function() { + _refreshColors: function () { var self = this; var ctx = this._getContext(); - _.each(this.dashboard_color_data, function(data) { + _.each(this.dashboard_color_data, function (data) { var color = py.eval(data[1], { context: _.extend(ctx, { - __getattr__: function() { + __getattr__: function () { return false; }, }), - check_if: function(args) { + check_if: function (args) { if (args[0].toJSON()) { return args[1]; } diff --git a/kpi_dashboard/static/src/js/dashboard_model.js b/kpi_dashboard/static/src/js/dashboard_model.js index bd15e6437..368e22fe4 100644 --- a/kpi_dashboard/static/src/js/dashboard_model.js +++ b/kpi_dashboard/static/src/js/dashboard_model.js @@ -1,16 +1,16 @@ -odoo.define("kpi_dashboard.DashboardModel", function(require) { +odoo.define("kpi_dashboard.DashboardModel", function (require) { "use strict"; var BasicModel = require("web.BasicModel"); var DashboardModel = BasicModel.extend({ - _fetchRecord: function(record) { + _fetchRecord: function (record) { return this._rpc({ model: record.model, method: "read_dashboard", args: [[record.res_id]], context: _.extend({}, record.getContext(), {bin_size: true}), - }).then(function(result) { + }).then(function (result) { record.specialData = result; return result; }); diff --git a/kpi_dashboard/static/src/js/dashboard_renderer.js b/kpi_dashboard/static/src/js/dashboard_renderer.js index 823831e54..0a080c4a0 100644 --- a/kpi_dashboard/static/src/js/dashboard_renderer.js +++ b/kpi_dashboard/static/src/js/dashboard_renderer.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.DashboardRenderer", function(require) { +odoo.define("kpi_dashboard.DashboardRenderer", function (require) { "use strict"; var BasicRenderer = require("web.BasicRenderer"); @@ -8,25 +8,25 @@ odoo.define("kpi_dashboard.DashboardRenderer", function(require) { var DashboardRenderer = BasicRenderer.extend({ className: "o_dashboard_view", - _getDashboardWidget: function(kpi) { + _getDashboardWidget: function (kpi) { var Widget = registry.getAny([kpi.widget, "abstract"]); var widget = new Widget(this, kpi); return widget; }, - _onClickModifyContext: function(modify_context_expression, event) { + _onClickModifyContext: function (modify_context_expression, event) { this.trigger_up("modify_context", { context: modify_context_expression, event: event, }); }, - _renderView: function() { + _renderView: function () { this.$el.html($(qweb.render("dashboard_kpi.dashboard"))); this.$el.css("background-color", this.state.specialData.background_color); this.$el.find(".gridster").css("width", this.state.specialData.width); this.$grid = this.$el.find(".gridster ul"); var self = this; this.kpi_widget = {}; - _.each(this.state.specialData.item_ids, function(kpi) { + _.each(this.state.specialData.item_ids, function (kpi) { var element = $(qweb.render("kpi_dashboard.kpi", {widget: kpi})); element.css("background-color", kpi.color); element.css("color", kpi.font_color); @@ -72,7 +72,7 @@ odoo.define("kpi_dashboard.DashboardRenderer", function(require) { this.call("bus_service", "onNotification", this, this._onNotification); if (this.state.specialData.compute_on_fly_refresh > 0) { // Setting the refresh interval - this.on_fly_interval = setInterval(function() { + this.on_fly_interval = setInterval(function () { self.trigger_up("refresh_on_fly"); }, this.state.specialData.compute_on_fly_refresh * 1000); } @@ -82,16 +82,16 @@ odoo.define("kpi_dashboard.DashboardRenderer", function(require) { // context return $.when(); }, - on_detach_callback: function() { + on_detach_callback: function () { // We want to clear the refresh interval once we exit the view if (this.on_fly_interval) { clearInterval(this.on_fly_interval); } this._super.apply(this, arguments); }, - _onNotification: function(notifications) { + _onNotification: function (notifications) { var self = this; - _.each(notifications, function(notification) { + _.each(notifications, function (notification) { var channel = notification[0]; var message = notification[1]; if (channel === self.channel && message) { diff --git a/kpi_dashboard/static/src/js/dashboard_view.js b/kpi_dashboard/static/src/js/dashboard_view.js index e83dc991f..114fd061e 100644 --- a/kpi_dashboard/static/src/js/dashboard_view.js +++ b/kpi_dashboard/static/src/js/dashboard_view.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.DashboardView", function(require) { +odoo.define("kpi_dashboard.DashboardView", function (require) { "use strict"; var BasicView = require("web.BasicView"); @@ -24,7 +24,7 @@ odoo.define("kpi_dashboard.DashboardView", function(require) { }), multi_record: false, searchable: false, - init: function() { + init: function () { this._super.apply(this, arguments); this.controllerParams.mode = "readonly"; this.loadParams.type = "record"; diff --git a/kpi_dashboard/static/src/js/field_widget.js b/kpi_dashboard/static/src/js/field_widget.js index 3c9a61408..00454f345 100644 --- a/kpi_dashboard/static/src/js/field_widget.js +++ b/kpi_dashboard/static/src/js/field_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.KpiFieldWidget", function(require) { +odoo.define("kpi_dashboard.KpiFieldWidget", function (require) { "use strict"; var basic_fields = require("web.basic_fields"); @@ -11,7 +11,7 @@ odoo.define("kpi_dashboard.KpiFieldWidget", function(require) { jsLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.js"], cssLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.css"], className: "o_dashboard_view", - _renderReadonly: function() { + _renderReadonly: function () { this.$el.html($(qweb.render("dashboard_kpi.dashboard"))); var marginx = 0; var marginy = 0; diff --git a/kpi_dashboard/static/src/js/lib/nvd3.js b/kpi_dashboard/static/src/js/lib/nvd3.js index e27fe6025..3d638c33a 100644 --- a/kpi_dashboard/static/src/js/lib/nvd3.js +++ b/kpi_dashboard/static/src/js/lib/nvd3.js @@ -1,7 +1,7 @@ /* global nv */ -odoo.define("web.nvd3.extensions", function() { +odoo.define("web.nvd3.extensions", function () { "use strict"; /** @@ -16,7 +16,7 @@ odoo.define("web.nvd3.extensions", function() { // see https://github.com/novus/nvd3/pull/396 for more details // Adds a resize listener to the window. - nv.utils.onWindowResize = function(fun) { + nv.utils.onWindowResize = function (fun) { if (fun === null) return; window.addEventListener("resize", fun); }; @@ -25,7 +25,7 @@ odoo.define("web.nvd3.extensions", function() { nv.utils.windowResize = nv.utils.onWindowResize; // Removes a resize listener from the window. - nv.utils.offWindowResize = function(fun) { + nv.utils.offWindowResize = function (fun) { if (fun === null) return; window.removeEventListener("resize", fun); }; @@ -33,7 +33,7 @@ odoo.define("web.nvd3.extensions", function() { // Monkey patch nvd3 to prevent crashes when user changes view and nvd3 // tries to remove tooltips after 500 ms... seriously nvd3, what were you // thinking? - nv.tooltip.cleanup = function() { + nv.tooltip.cleanup = function () { $(".nvtooltip").remove(); }; @@ -41,7 +41,7 @@ odoo.define("web.nvd3.extensions", function() { // with a negative `top`; with this patch the highest tooltip's position is // still in the graph var originalCalcTooltipPosition = nv.tooltip.calcTooltipPosition; - nv.tooltip.calcTooltipPosition = function() { + nv.tooltip.calcTooltipPosition = function () { var container = originalCalcTooltipPosition.apply(this, arguments); container.style.top = container.style.top.split("px")[0] < 0 ? 0 + "px" : container.style.top; diff --git a/kpi_dashboard/static/src/js/widget/abstract_widget.js b/kpi_dashboard/static/src/js/widget/abstract_widget.js index 22ee823c6..8a77db907 100644 --- a/kpi_dashboard/static/src/js/widget/abstract_widget.js +++ b/kpi_dashboard/static/src/js/widget/abstract_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.AbstractWidget", function(require) { +odoo.define("kpi_dashboard.AbstractWidget", function (require) { "use strict"; var Widget = require("web.Widget"); var field_utils = require("web.field_utils"); @@ -17,7 +17,7 @@ odoo.define("kpi_dashboard.AbstractWidget", function(require) { "click .o_kpi_dashboard_toggle_button": "_onClickToggleButton", "click .direct_action": "_onClickDirectAction", }, - init: function(parent, kpi_values) { + init: function (parent, kpi_values) { this._super(parent); this.col = kpi_values.col; this.row = kpi_values.row; @@ -37,21 +37,21 @@ odoo.define("kpi_dashboard.AbstractWidget", function(require) { this.widget_size_y = this.widget_dimension_y * this.sizey + (this.sizey - 1) * this.margin_y; }, - willStart: function() { + willStart: function () { // We need to load the libraries before the start return $.when(ajax.loadLibs(this), this._super.apply(this, arguments)); }, - start: function() { + start: function () { var self = this; - return this._super.apply(this, arguments).then(function() { + return this._super.apply(this, arguments).then(function () { self._fillWidget(self.values); }); }, - _onClickToggleButton: function(event) { + _onClickToggleButton: function (event) { event.preventDefault(); this.$el.toggleClass("o_dropdown_open"); }, - _fillWidget: function(values) { + _fillWidget: function (values) { // This function fills the widget values if (this.$el === undefined) return; this.fillWidget(values); @@ -73,20 +73,20 @@ odoo.define("kpi_dashboard.AbstractWidget", function(require) { if ($manage && this.showManagePanel(values)) $manage.toggleClass("hidden", false); }, - showManagePanel: function(values) { + showManagePanel: function (values) { // Hook for extensions return values.actions !== undefined; }, - fillWidget: function(values) { + fillWidget: function (values) { // Specific function that will be changed by specific widget var value = values.value; var self = this; - _.each(value, function(val, key) { + _.each(value, function (val, key) { var item = self.$el.find("[data-bind=" + key + "]"); if (item) item.text(val); }); }, - _onClickDirectAction: function(event) { + _onClickDirectAction: function (event) { event.preventDefault(); var $data = $(event.currentTarget).closest("a"); var action = this.actions[$($data).data("id")]; diff --git a/kpi_dashboard/static/src/js/widget/counter_widget.js b/kpi_dashboard/static/src/js/widget/counter_widget.js index 54d7f8ccc..6a37b710c 100644 --- a/kpi_dashboard/static/src/js/widget/counter_widget.js +++ b/kpi_dashboard/static/src/js/widget/counter_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.CounterWidget", function(require) { +odoo.define("kpi_dashboard.CounterWidget", function (require) { "use strict"; var IntegerWidget = require("kpi_dashboard.IntegerWidget"); diff --git a/kpi_dashboard/static/src/js/widget/graph_widget.js b/kpi_dashboard/static/src/js/widget/graph_widget.js index 91820b4b0..a6871acdb 100644 --- a/kpi_dashboard/static/src/js/widget/graph_widget.js +++ b/kpi_dashboard/static/src/js/widget/graph_widget.js @@ -1,7 +1,7 @@ /* global nv, d3 */ -odoo.define("kpi_dashboard.GraphWidget", function(require) { +odoo.define("kpi_dashboard.GraphWidget", function (require) { "use strict"; var AbstractWidget = require("kpi_dashboard.AbstractWidget"); @@ -17,12 +17,12 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { "/kpi_dashboard/static/src/js/lib/nvd3.js", ], cssLibs: ["/kpi_dashboard/static/lib/nvd3/nv.d3.css"], - start: function() { + start: function () { this._onResize = this._onResize.bind(this); nv.utils.windowResize(this._onResize); return this._super.apply(this, arguments); }, - destroy: function() { + destroy: function () { if ("nv" in window && nv.utils && nv.utils.offWindowResize) { // If the widget is destroyed before the lazy loaded libs (nv) are // actually loaded (i.e. after the widget has actually started), @@ -31,9 +31,9 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { } this._super.apply(this, arguments); }, - _getChartOptions: function() { + _getChartOptions: function () { return { - x: function(d, u) { + x: function (d, u) { return u; }, margin: {left: 0, right: 0, top: 5, bottom: 0}, @@ -44,11 +44,11 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { width: this.widget_size_x - 20, }; }, - _chartConfiguration: function(values) { + _chartConfiguration: function (values) { this.chart.forceY([0]); - this.chart.xAxis.tickFormat(function(d) { + this.chart.xAxis.tickFormat(function (d) { var label = ""; - _.each(values.value.graphs, function(v) { + _.each(values.value.graphs, function (v) { if (v.values[d] && v.values[d].x) { label = v.values[d].x; } @@ -57,7 +57,7 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { }); this.chart.yAxis.tickFormat(d3.format(",.2f")); - this.chart.tooltip.contentGenerator(function(key) { + this.chart.tooltip.contentGenerator(function (key) { return qweb.render("GraphCustomTooltip", { color: key.point.color, key: key.series[0].title, @@ -65,7 +65,7 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { }); }); }, - _addGraph: function(values) { + _addGraph: function (values) { var data = values.value.graphs; this.$svg.addClass("o_graph_linechart"); this.chart = nv.models.lineChart(); @@ -79,23 +79,23 @@ odoo.define("kpi_dashboard.GraphWidget", function(require) { this.$("svg").css("height", this.widget_size_y - 90); this._customizeChart(); }, - fillWidget: function(values) { + fillWidget: function (values) { var self = this; var element = this.$el.find('[data-bind="value"]'); element.empty(); element.css("padding-left", 10).css("padding-right", 10); this.chart = null; - nv.addGraph(function() { + nv.addGraph(function () { self.$svg = self.$el .find('[data-bind="value"]') .append(""); self._addGraph(values); }); }, - _customizeChart: function() { + _customizeChart: function () { // Hook function }, - _onResize: function() { + _onResize: function () { if (this.chart) { this.chart.update(); this._customizeChart(); diff --git a/kpi_dashboard/static/src/js/widget/integer_widget.js b/kpi_dashboard/static/src/js/widget/integer_widget.js index 5ba03e0ee..06a8a5ae9 100644 --- a/kpi_dashboard/static/src/js/widget/integer_widget.js +++ b/kpi_dashboard/static/src/js/widget/integer_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.IntegerWidget", function(require) { +odoo.define("kpi_dashboard.IntegerWidget", function (require) { "use strict"; var AbstractWidget = require("kpi_dashboard.AbstractWidget"); @@ -14,12 +14,12 @@ odoo.define("kpi_dashboard.IntegerWidget", function(require) { [1000000, "M", [3, 1]], [1000, "K", [3, 1]], ], - shortNumber: function(num) { + shortNumber: function (num) { var suffix = ""; var shortened = false; var digits = this.digits; var result = num; - _.each(this.shortList, function(shortItem) { + _.each(this.shortList, function (shortItem) { if (!shortened && Math.abs(num) >= shortItem[0]) { shortened = true; suffix = shortItem[1]; @@ -33,7 +33,7 @@ odoo.define("kpi_dashboard.IntegerWidget", function(require) { }) + suffix ); }, - fillWidget: function(values) { + fillWidget: function (values) { var widget = this.$el; var value = values.value.value; if (value === undefined) { diff --git a/kpi_dashboard/static/src/js/widget/meter_widget.js b/kpi_dashboard/static/src/js/widget/meter_widget.js index 606e38746..9ca051f59 100644 --- a/kpi_dashboard/static/src/js/widget/meter_widget.js +++ b/kpi_dashboard/static/src/js/widget/meter_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.MeterWidget", function(require) { +odoo.define("kpi_dashboard.MeterWidget", function (require) { "use strict"; var AbstractWidget = require("kpi_dashboard.AbstractWidget"); @@ -7,14 +7,14 @@ odoo.define("kpi_dashboard.MeterWidget", function(require) { var MeterWidget = AbstractWidget.extend({ template: "kpi_dashboard.meter", jsLibs: ["/kpi_dashboard/static/lib/gauge/GaugeMeter.js"], - fillWidget: function(values) { + fillWidget: function (values) { var input = this.$el.find('[data-bind="value"]'); var options = this._getMeterOptions(values); var margin = (this.widget_dimension_x - options.size) / 2; input.gaugeMeter(options); input.parent().css("padding-left", margin); }, - _getMeterOptions: function(values) { + _getMeterOptions: function (values) { var size = Math.min(this.widget_size_x, this.widget_size_y - 40) - 10; return { percent: values.value.value, diff --git a/kpi_dashboard/static/src/js/widget/number_widget.js b/kpi_dashboard/static/src/js/widget/number_widget.js index 92b9e0481..0379c8dca 100644 --- a/kpi_dashboard/static/src/js/widget/number_widget.js +++ b/kpi_dashboard/static/src/js/widget/number_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.NumberWidget", function(require) { +odoo.define("kpi_dashboard.NumberWidget", function (require) { "use strict"; var IntegerWidget = require("kpi_dashboard.IntegerWidget"); @@ -7,7 +7,7 @@ odoo.define("kpi_dashboard.NumberWidget", function(require) { var NumberWidget = IntegerWidget.extend({ digits: [3, 1], - shortNumber: function(num) { + shortNumber: function (num) { if (Math.abs(num) < 10) { return field_utils.format.float(num, false, { digits: [3, 2], diff --git a/kpi_dashboard/static/src/js/widget/text_widget.js b/kpi_dashboard/static/src/js/widget/text_widget.js index 05efc5176..d5c4f21f2 100644 --- a/kpi_dashboard/static/src/js/widget/text_widget.js +++ b/kpi_dashboard/static/src/js/widget/text_widget.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.TextWidget", function(require) { +odoo.define("kpi_dashboard.TextWidget", function (require) { "use strict"; var AbstractWidget = require("kpi_dashboard.AbstractWidget"); @@ -6,7 +6,7 @@ odoo.define("kpi_dashboard.TextWidget", function(require) { var TextWidget = AbstractWidget.extend({ template: "kpi_dashboard.base_text", - fillWidget: function() { + fillWidget: function () { return; }, }); diff --git a/kpi_dashboard/static/src/js/widget_registry.js b/kpi_dashboard/static/src/js/widget_registry.js index 105a5a3a8..554bfe1d5 100644 --- a/kpi_dashboard/static/src/js/widget_registry.js +++ b/kpi_dashboard/static/src/js/widget_registry.js @@ -1,4 +1,4 @@ -odoo.define("kpi_dashboard.widget_registry", function(require) { +odoo.define("kpi_dashboard.widget_registry", function (require) { "use strict"; var Registry = require("web.Registry"); diff --git a/kpi_dashboard/static/src/xml/dashboard.xml b/kpi_dashboard/static/src/xml/dashboard.xml index e5de783f9..c710744ab 100644 --- a/kpi_dashboard/static/src/xml/dashboard.xml +++ b/kpi_dashboard/static/src/xml/dashboard.xml @@ -29,7 +29,10 @@ class="direct_action" t-att-data-id="action_id" t-att-data-type="action.type" - >Go to + > + Go to + + diff --git a/kpi_dashboard/tests/test_formula.py b/kpi_dashboard/tests/test_formula.py index 1c707150a..20720288a 100644 --- a/kpi_dashboard/tests/test_formula.py +++ b/kpi_dashboard/tests/test_formula.py @@ -45,7 +45,8 @@ result = {{}} result['value'] = len(model.search([('id', '=', {})])) result['previous'] = len(model.search([('id', '!=', {})])) """.format( - self.kpi.id, self.kpi.id, + self.kpi.id, + self.kpi.id, ) self.kpi.compute() value = self.kpi.value @@ -65,7 +66,8 @@ result = {{}} result['value'] = len(model.search([('id', '=', {})])) result['previous'] = len(model.search([('id', '!=', {})])) """.format( - self.kpi.id, self.kpi.id, + self.kpi.id, + self.kpi.id, ) self.kpi.compute() value = self.kpi.value diff --git a/kpi_dashboard/views/kpi_dashboard.xml b/kpi_dashboard/views/kpi_dashboard.xml index faac1a8ec..e919d3d9c 100644 --- a/kpi_dashboard/views/kpi_dashboard.xml +++ b/kpi_dashboard/views/kpi_dashboard.xml @@ -166,7 +166,7 @@