summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph_view.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-02-25 10:13:10 +0100
committerGery Debongnie <ged@openerp.com>2014-02-25 10:13:10 +0100
commit893b7041f97a5f98dbb95affdfeecbcdb6db69ed (patch)
tree463444a7e755b66a6fb3f7aefc5c5f2b6a6bf074 /addons/web_graph/static/src/js/graph_view.js
parent2ab61cf001fab1d30050598931bfa39956cf4883 (diff)
parenteaa20f9586f5d9a7a52ed5a7cc565d620e0ad44a (diff)
[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140225091310-pzkj5ip17esl52kz
Diffstat (limited to 'addons/web_graph/static/src/js/graph_view.js')
-rw-r--r--addons/web_graph/static/src/js/graph_view.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/addons/web_graph/static/src/js/graph_view.js b/addons/web_graph/static/src/js/graph_view.js
index c29c78e7e33..4e799c82afd 100644
--- a/addons/web_graph/static/src/js/graph_view.js
+++ b/addons/web_graph/static/src/js/graph_view.js
@@ -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'});