[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140225091310-pzkj5ip17esl52kz
This commit is contained in:
@@ -77,16 +77,25 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
||||
},
|
||||
|
||||
do_search: function (domain, context, group_by) {
|
||||
if (this.ignore_do_search) {
|
||||
this.ignore_do_search = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this,
|
||||
<<<<<<< TREE
|
||||
groupbys = this.get_groupbys_dos(),
|
||||
col_group_by = groupbys.col_group_by;
|
||||
=======
|
||||
col_group_by = self.get_groupbys_from_searchview('ColGroupBy', 'col_group_by');
|
||||
>>>>>>> MERGE-SOURCE
|
||||
|
||||
if (!this.graph_widget) {
|
||||
if (group_by.length) {
|
||||
this.widget_config.row_groupby = group_by;
|
||||
}
|
||||
if (col_group_by.length) {
|
||||
this.widget_config.col_groupby = group_by;
|
||||
this.widget_config.col_groupby = col_group_by;
|
||||
}
|
||||
this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);
|
||||
this.graph_widget.appendTo(this.$el);
|
||||
@@ -140,6 +149,14 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
||||
|
||||
if (!_.has(this.search_view, '_s_groupby')) { return; }
|
||||
|
||||
if (row_groupby.length && col_groupby.length) {
|
||||
// when two changes to the search view will be done, the method do_search
|
||||
// will be called twice, once with the correct groupby and incorrect col_groupby,
|
||||
// and once with correct informations. This flag is necessary to prevent the
|
||||
// incorrect informations to propagate and trigger useless queries
|
||||
this.ignore_do_search = true;
|
||||
}
|
||||
|
||||
// add row groupbys
|
||||
var row_facet = this.make_row_groupby_facets(row_groupby),
|
||||
row_search_facet = query.findWhere({category:'GroupBy'});
|
||||
|
||||
@@ -263,9 +263,6 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
|
||||
case 'swap_axis':
|
||||
this.swap_axis();
|
||||
break;
|
||||
case 'expand_all':
|
||||
this.pivot.expand_all().then(this.proxy('display_data'));
|
||||
break;
|
||||
case 'update_values':
|
||||
this.pivot.update_data().then(this.proxy('display_data'));
|
||||
break;
|
||||
@@ -295,25 +292,30 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
|
||||
|
||||
if (header.expanded) {
|
||||
this.fold(header);
|
||||
} else {
|
||||
if (header.path.length < header.root.groupby.length) {
|
||||
this.expand(id);
|
||||
} else {
|
||||
if (!this.important_fields.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fields = _.map(this.important_fields, function (field) {
|
||||
return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};
|
||||
});
|
||||
this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));
|
||||
$(event.target).after(this.dropdown);
|
||||
this.dropdown.css({position:'absolute',
|
||||
left:event.pageX,
|
||||
top:event.pageY});
|
||||
this.$('.field-selection').next('.dropdown-menu').toggle();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (header.path.length < header.root.groupby.length) {
|
||||
this.expand(id);
|
||||
return;
|
||||
}
|
||||
if (!this.important_fields.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fields = _.map(this.important_fields, function (field) {
|
||||
return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};
|
||||
});
|
||||
if (this.dropdown) {
|
||||
this.dropdown.remove();
|
||||
}
|
||||
this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));
|
||||
$(event.target).after(this.dropdown);
|
||||
this.dropdown.css({position:'absolute',
|
||||
left:event.pageX,
|
||||
top:event.pageY});
|
||||
this.$('.field-selection').next('.dropdown-menu').toggle();
|
||||
|
||||
|
||||
},
|
||||
|
||||
field_selection: function (event) {
|
||||
|
||||
@@ -35,9 +35,6 @@
|
||||
<label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">
|
||||
<span class="fa fa-expand"></span>
|
||||
</label>
|
||||
<label class="btn btn-default" data-choice="expand_all" title="Expand All">
|
||||
<span class="fa fa-arrows-alt"></span>
|
||||
</label>
|
||||
<label class="btn btn-default" data-choice="update_values" title="Reload Data">
|
||||
<span class="fa fa-refresh"></span>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user