Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 17, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; at the end

_.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){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space between if and the expression

data[self.grouped_by[0]] = group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; at the end.

}
var id = item.evt.id;
this.dataset.write(id, data);
},
Expand Down