From 46771532704766df8c35f68cb8fe3f39b13c00e4 Mon Sep 17 00:00:00 2001 From: tarteo Date: Wed, 16 Jan 2019 14:11:31 +0100 Subject: [PATCH] [FIX] web_timeline: Reloading view [FIX] web_timeline: Reloading view [FIX] web_timeline: Reloading view --- web_timeline/__manifest__.py | 2 +- .../static/src/js/timeline_controller.js | 29 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/web_timeline/__manifest__.py b/web_timeline/__manifest__.py index e376f9af..399a8d86 100644 --- a/web_timeline/__manifest__.py +++ b/web_timeline/__manifest__.py @@ -4,7 +4,7 @@ { 'name': "Web timeline", 'summary': "Interactive visualization chart to show events in time", - "version": "12.0.1.0.2", + "version": "12.0.1.0.3", "development_status": "Production/Stable", 'author': 'ACSONE SA/NV, ' 'Tecnativa, ' diff --git a/web_timeline/static/src/js/timeline_controller.js b/web_timeline/static/src/js/timeline_controller.js index 2301fe54..1e2969fe 100644 --- a/web_timeline/static/src/js/timeline_controller.js +++ b/web_timeline/static/src/js/timeline_controller.js @@ -37,9 +37,9 @@ odoo.define('web_timeline.TimelineController', function (require) { * @override */ update: function (params, options) { - this._super.apply(this, arguments); + var res = this._super.apply(this, arguments); if (_.isEmpty(params)){ - return; + return res; } var defaults = _.defaults({}, options, { adjust_window: true @@ -63,17 +63,20 @@ odoo.define('web_timeline.TimelineController', function (require) { var fields = this.renderer.fieldNames; fields = _.uniq(fields.concat(n_group_bys)); - self._rpc({ - model: self.model.modelName, - method: 'search_read', - kwargs: { - fields: fields, - domain: domains, - }, - context: self.getSession().user_context, - }).then(function(data) { - return self.renderer.on_data_loaded(data, n_group_bys, defaults.adjust_window); - }); + return $.when( + res, + self._rpc({ + model: self.model.modelName, + method: 'search_read', + kwargs: { + fields: fields, + domain: domains, + }, + context: self.getSession().user_context, + }).then(function (data) { + return self.renderer.on_data_loaded(data, n_group_bys, defaults.adjust_window); + }) + ); }, /**