summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-12-19 13:54:22 +0100
committerGery Debongnie <ged@openerp.com>2013-12-19 13:54:22 +0100
commit7fc2afc5162124e213af84327b87cdc97ec9dec0 (patch)
tree66fa4b8dab44c6ec84d1775705e49a1b9edaff61 /addons/web_graph/static/src/js
parent5e1aebc4b5c720205307467b6af390f0b1f261d1 (diff)
[FIX] properly handles the situation where a user selected twice the same field in the search view groupbys (it simply added the field twice to groupbys instead of removing it (addon web_graph)
bzr revid: ged@openerp.com-20131219125422-n2rpzbekyg7e0eyh
Diffstat (limited to 'addons/web_graph/static/src/js')
-rw-r--r--addons/web_graph/static/src/js/graph.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 336be536346..a473e4df042 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -22,6 +22,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.dataset = dataset;
this.model = new instance.web.Model(dataset.model, {group_by_no_leaf: true});
this.search_view = parent.searchview;
+ this.search_view_groupby = [];
this.groupby_mode = 'default'; // 'default' or 'manual'
this.default_row_groupby = [];
this.default_col_groupby = [];
@@ -76,6 +77,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
col_groupby = context.col_group_by || [],
options = {domain:domain};
+ this.search_view_groupby = group_by;
if (group_by.length || col_groupby.length) {
this.groupby_mode = 'manual';
}
@@ -106,8 +108,11 @@ instance.web_graph.GraphView = instance.web.View.extend({
register_groupby: function() {
var self = this,
query = this.search_view.query;
- this.groupby_mode = 'manual';
+ this.groupby_mode = 'manual';
+ if (_.isEqual(this.search_view_groupby, this.graph_widget.pivot.rows.groupby)) {
+ return;
+ }
var rows = _.map(this.graph_widget.pivot.rows.groupby, function (group) {
return make_facet('GroupBy', group);
});