Skip to content

Commit

Permalink
[10.0] [FIX] [web_timeline] Correct write when grouped by (OCA#678)
Browse files Browse the repository at this point in the history
* [FIX] Correct write when grouped by

* Remove blank lines

* Minor changes
  • Loading branch information
JBF91 authored and Yanina Aular committed May 14, 2018
1 parent 0f8670d commit 985fd57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web_timeline/static/src/js/web_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
},
Expand Down

0 comments on commit 985fd57

Please sign in to comment.