From b8ee1dc6b669a9f17211e5f8501884827edc8d10 Mon Sep 17 00:00:00 2001 From: Jose M Date: Thu, 17 Aug 2017 13:35:33 +0200 Subject: [PATCH] [10.0] [FIX] [web_timeline] Correct write when grouped by (#678) * [FIX] Correct write when grouped by * Remove blank lines * Minor changes --- web_timeline/static/src/js/web_timeline.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_timeline/static/src/js/web_timeline.js b/web_timeline/static/src/js/web_timeline.js index 22107c68ede4..1f152d01fa68 100644 --- a/web_timeline/static/src/js/web_timeline.js +++ b/web_timeline/static/src/js/web_timeline.js @@ -36,6 +36,7 @@ odoo.define('web_timeline.TimelineView', function (require) { init: function (parent, dataset, view_id, options) { this.permissions = {}; + this.grouped_by = false; return this._super.apply(this, arguments); }, @@ -283,6 +284,7 @@ odoo.define('web_timeline.TimelineView', function (require) { var self = this; var data = []; var groups = []; + this.grouped_by = group_bys; _.each(events, function(event) { if (event[self.date_start]){ data.push(self.event_data_transform(event)); @@ -404,7 +406,9 @@ odoo.define('web_timeline.TimelineView', function (require) { time.auto_date_to_str(start, self.fields[self.fields_view.arch.attrs.date_start].type); data[self.fields_view.arch.attrs.date_stop] = time.auto_date_to_str(end, self.fields[self.fields_view.arch.attrs.date_stop].type); - data[self.fields_view.arch.attrs.default_group_by] = group; + if (self.grouped_by){ + data[self.grouped_by[0]] = group; + } var id = item.evt.id; this.dataset.write(id, data); },