[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
pull/2293/head
jguenat 2022-09-14 19:39:08 +02:00 committed by jguenat
parent 06e6adad58
commit 5cb4d75892
1 changed files with 2 additions and 4 deletions

View File

@ -270,12 +270,12 @@ odoo.define("web_timeline.TimelineController", function (require) {
} }
if (this.date_start) { if (this.date_start) {
default_context["default_".concat(this.date_start)] = moment(item.start) default_context["default_".concat(this.date_start)] = moment(item.start)
.add(1, "hours") .utc()
.format("YYYY-MM-DD HH:mm:ss"); .format("YYYY-MM-DD HH:mm:ss");
} }
if (this.date_stop && item.end) { if (this.date_stop && item.end) {
default_context["default_".concat(this.date_stop)] = moment(item.end) default_context["default_".concat(this.date_stop)] = moment(item.end)
.add(1, "hours") .utc()
.format("YYYY-MM-DD HH:mm:ss"); .format("YYYY-MM-DD HH:mm:ss");
} }
if (item.group > 0) { 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 new_event = this.renderer.event_data_transform(records[0]);
var items = this.renderer.timeline.itemsData; var items = this.renderer.timeline.itemsData;
items.add(new_event); items.add(new_event);
this.renderer.timeline.setItems(items);
this.reload();
}); });
}, },