From 92eedca5d99384bc29d44b6794aef87ef46e8ac5 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 18 Jul 2022 06:44:33 +0200 Subject: [PATCH 1/2] [FIX] web_timeline: Don't crash when restoring timeline from breadcrumb --- web_timeline/static/src/js/timeline_controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_timeline/static/src/js/timeline_controller.js b/web_timeline/static/src/js/timeline_controller.js index 22271112b..9315af0a3 100644 --- a/web_timeline/static/src/js/timeline_controller.js +++ b/web_timeline/static/src/js/timeline_controller.js @@ -44,8 +44,8 @@ odoo.define("web_timeline.TimelineController", function(require) { adjust_window: true, }); const domains = params.domain; - const contexts = params.context; - const group_bys = params.groupBy; + const contexts = params.context || []; + const group_bys = params.groupBy || []; this.last_domains = domains; this.last_contexts = contexts; // Select the group by From 528799f9356e0d0857fc9f903efe5d85550350e8 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 19 Jul 2022 20:21:28 +0200 Subject: [PATCH 2/2] fixup! [FIX] web_timeline: Don't crash when restoring timeline from breadcrumb --- web_timeline/static/src/js/timeline_controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_timeline/static/src/js/timeline_controller.js b/web_timeline/static/src/js/timeline_controller.js index 9315af0a3..12f24fa67 100644 --- a/web_timeline/static/src/js/timeline_controller.js +++ b/web_timeline/static/src/js/timeline_controller.js @@ -43,9 +43,9 @@ odoo.define("web_timeline.TimelineController", function(require) { const defaults = _.defaults({}, options, { adjust_window: true, }); - const domains = params.domain; + const domains = params.domain || this.renderer.last_domains || []; const contexts = params.context || []; - const group_bys = params.groupBy || []; + const group_bys = params.groupBy || this.renderer.last_group_bys || []; this.last_domains = domains; this.last_contexts = contexts; // Select the group by