From 0842a5f26f61eb7e0270edf370ef0b8f8151483a Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 9 May 2023 10:24:54 +0200 Subject: [PATCH] [FIX] kpi_dashboard: Use getState function --- kpi_dashboard/i18n/kpi_dashboard.pot | 14 +++++++++----- .../static/src/js/dashboard_controller.js | 9 ++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/kpi_dashboard/i18n/kpi_dashboard.pot b/kpi_dashboard/i18n/kpi_dashboard.pot index 19ce95376..9753ecd7c 100644 --- a/kpi_dashboard/i18n/kpi_dashboard.pot +++ b/kpi_dashboard/i18n/kpi_dashboard.pot @@ -182,14 +182,11 @@ msgid "Cron" msgstr "" #. module: kpi_dashboard -#. openerp-web -#: 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 -#: 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 +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__ir_actions_act_window_view__view_mode__kpi_dashboard +#: model:ir.model.fields.selection,name:kpi_dashboard.selection__ir_ui_view__type__kpi_dashboard msgid "Dashboard" msgstr "" @@ -317,6 +314,13 @@ msgstr "" msgid "Item" msgstr "" +#. module: kpi_dashboard +#. openerp-web +#: code:addons/kpi_dashboard/static/src/js/dashboard_view.js:0 +#, python-format +msgid "KPI Dashboard" +msgstr "" + #. module: kpi_dashboard #: model:ir.ui.menu,name:kpi_dashboard.menu_configuration_kpi_dashboards msgid "KPI Dashboards" diff --git a/kpi_dashboard/static/src/js/dashboard_controller.js b/kpi_dashboard/static/src/js/dashboard_controller.js index ee8e9bc16..f13b995a0 100644 --- a/kpi_dashboard/static/src/js/dashboard_controller.js +++ b/kpi_dashboard/static/src/js/dashboard_controller.js @@ -46,12 +46,11 @@ odoo.define("kpi_dashboard.DashboardController", function (require) { }); this._super($node, options); }, - _pushState: function (state) { - // eslint-disable-next-line no-param-reassign - state = state || {}; - var env = this.model.get(this.handle, {env: true}); + getState: function () { + const state = this._super.apply(this, arguments); + const env = this.model.get(this.handle, {env: true}); state.id = env.currentId; - this._super(state); + return state; }, _addDashboard: function () { var self = this;