From 44565edb4956b4dec76cfe5fba200ed975655f15 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 7 Jul 2020 22:36:27 +0200 Subject: [PATCH] [IMP] do not show date for 'compute on fly' kpi --- kpi_dashboard/models/kpi_dashboard.py | 1 + kpi_dashboard/static/src/js/widget/abstract_widget.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kpi_dashboard/models/kpi_dashboard.py b/kpi_dashboard/models/kpi_dashboard.py index aa216754..09955fef 100644 --- a/kpi_dashboard/models/kpi_dashboard.py +++ b/kpi_dashboard/models/kpi_dashboard.py @@ -167,6 +167,7 @@ class KpiDashboardItem(models.Model): "kpi_id": self.kpi_id.id, "suffix": self.kpi_id.suffix or "", "prefix": self.kpi_id.prefix or "", + "compute_on_fly": self.kpi_id.compute_on_fly or "", } ) if self.kpi_id.compute_on_fly: diff --git a/kpi_dashboard/static/src/js/widget/abstract_widget.js b/kpi_dashboard/static/src/js/widget/abstract_widget.js index b99b2d9e..0babc377 100644 --- a/kpi_dashboard/static/src/js/widget/abstract_widget.js +++ b/kpi_dashboard/static/src/js/widget/abstract_widget.js @@ -54,7 +54,7 @@ odoo.define('kpi_dashboard.AbstractWidget', function (require) { return; this.fillWidget(values); var item = this.$el.find('[data-bind="value_last_update_display"]'); - if (item && values.value_last_update !== undefined) { + if (item && ! values.compute_on_fly && values.value_last_update !== undefined) { var value = field_utils.parse.datetime(values.value_last_update); item.text(value.clone().add( this.getSession().getTZOffset(value), 'minutes').format(