Browse Source

[10.0] [FIX] [web_timeline] Correct write when grouped by (#678)

* [FIX] Correct write when grouped by

* Remove blank lines

* Minor changes
pull/1090/head
Jose M 7 years ago
committed by tarteo
parent
commit
5a12aa1ff9
  1. 6
      web_timeline/static/src/js/web_timeline.js

6
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) { init: function (parent, dataset, view_id, options) {
this.permissions = {}; this.permissions = {};
this.grouped_by = false;
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
@ -283,6 +284,7 @@ odoo.define('web_timeline.TimelineView', function (require) {
var self = this; var self = this;
var data = []; var data = [];
var groups = []; var groups = [];
this.grouped_by = group_bys;
_.each(events, function(event) { _.each(events, function(event) {
if (event[self.date_start]){ if (event[self.date_start]){
data.push(self.event_data_transform(event)); 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); time.auto_date_to_str(start, self.fields[self.fields_view.arch.attrs.date_start].type);
data[self.fields_view.arch.attrs.date_stop] = data[self.fields_view.arch.attrs.date_stop] =
time.auto_date_to_str(end, self.fields[self.fields_view.arch.attrs.date_stop].type); 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; var id = item.evt.id;
this.dataset.write(id, data); this.dataset.write(id, data);
}, },

Loading…
Cancel
Save