From 5cb4d75892bf619eed8ed8058ad79c909dbd3789 Mon Sep 17 00:00:00 2001 From: jguenat Date: Wed, 14 Sep 2022 19:39:08 +0200 Subject: [PATCH 1/2] [FIX] web_timeline: utc and create_completed fix wrong time used when creating new record on record creation timeline view was reloaded and all items disappeared fix by removing unnecessary reload --- web_timeline/static/src/js/timeline_controller.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web_timeline/static/src/js/timeline_controller.js b/web_timeline/static/src/js/timeline_controller.js index dcf266aac..b147aff7a 100644 --- a/web_timeline/static/src/js/timeline_controller.js +++ b/web_timeline/static/src/js/timeline_controller.js @@ -270,12 +270,12 @@ odoo.define("web_timeline.TimelineController", function (require) { } if (this.date_start) { default_context["default_".concat(this.date_start)] = moment(item.start) - .add(1, "hours") + .utc() .format("YYYY-MM-DD HH:mm:ss"); } if (this.date_stop && item.end) { default_context["default_".concat(this.date_stop)] = moment(item.end) - .add(1, "hours") + .utc() .format("YYYY-MM-DD HH:mm:ss"); } if (item.group > 0) { @@ -317,8 +317,6 @@ odoo.define("web_timeline.TimelineController", function (require) { var new_event = this.renderer.event_data_transform(records[0]); var items = this.renderer.timeline.itemsData; items.add(new_event); - this.renderer.timeline.setItems(items); - this.reload(); }); }, From 30566450253d101dea4756ee6340bfc90c0efd32 Mon Sep 17 00:00:00 2001 From: jguenat Date: Sat, 29 Oct 2022 13:50:39 +0200 Subject: [PATCH 2/2] [FIX] web_timeline: updateProm.finally is not a function Following odoo#102621 an UncaughtPromiseError > TypeError occured each time an update was triggered in timeline view Fixed by returning super --- web_timeline/static/src/js/timeline_controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_timeline/static/src/js/timeline_controller.js b/web_timeline/static/src/js/timeline_controller.js index b147aff7a..bd814f0aa 100644 --- a/web_timeline/static/src/js/timeline_controller.js +++ b/web_timeline/static/src/js/timeline_controller.js @@ -58,7 +58,7 @@ odoo.define("web_timeline.TimelineController", function (require) { let fields = this.renderer.fieldNames; fields = _.uniq(fields.concat(n_group_bys)); - return $.when( + $.when( res, this._rpc({ model: this.model.modelName, @@ -77,6 +77,7 @@ odoo.define("web_timeline.TimelineController", function (require) { ) ) ); + return res; }, /**