Browse Source

[IMP] do not show date for 'compute on fly' kpi

myc-14.0-py3o
Sylvain LE GAL 4 years ago
committed by Enric Tobella
parent
commit
44565edb49
  1. 1
      kpi_dashboard/models/kpi_dashboard.py
  2. 2
      kpi_dashboard/static/src/js/widget/abstract_widget.js

1
kpi_dashboard/models/kpi_dashboard.py

@ -167,6 +167,7 @@ class KpiDashboardItem(models.Model):
"kpi_id": self.kpi_id.id, "kpi_id": self.kpi_id.id,
"suffix": self.kpi_id.suffix or "", "suffix": self.kpi_id.suffix or "",
"prefix": self.kpi_id.prefix or "", "prefix": self.kpi_id.prefix or "",
"compute_on_fly": self.kpi_id.compute_on_fly or "",
} }
) )
if self.kpi_id.compute_on_fly: if self.kpi_id.compute_on_fly:

2
kpi_dashboard/static/src/js/widget/abstract_widget.js

@ -54,7 +54,7 @@ odoo.define('kpi_dashboard.AbstractWidget', function (require) {
return; return;
this.fillWidget(values); this.fillWidget(values);
var item = this.$el.find('[data-bind="value_last_update_display"]'); 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); var value = field_utils.parse.datetime(values.value_last_update);
item.text(value.clone().add( item.text(value.clone().add(
this.getSession().getTZOffset(value), 'minutes').format( this.getSession().getTZOffset(value), 'minutes').format(

Loading…
Cancel
Save