summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-12-20 13:39:25 +0100
committerGery Debongnie <ged@openerp.com>2013-12-20 13:39:25 +0100
commite844ba1040aa3ea52792324272e3a39a9df2ea6e (patch)
tree5964931a3ca273368990ed1ed54cf82ce52d13a0 /addons/web_graph/static/src/js
parent828d06f174b6892cfbe11fe454eb659589b17720 (diff)
[FIX] prevents a crash happening in some cases when the searchview does not initialize a groupbygroup instance before the method register_groupby in graph view used it (addon web_graph)
bzr revid: ged@openerp.com-20131220123925-qycdvanm51nkc4uo
Diffstat (limited to 'addons/web_graph/static/src/js')
-rw-r--r--addons/web_graph/static/src/js/graph.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 4eeaec194eb..b966a38e898 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -127,7 +127,8 @@ instance.web_graph.GraphView = instance.web.View.extend({
query = this.search_view.query;
this.groupby_mode = 'manual';
- if (_.isEqual(this.search_view_groupby, this.graph_widget.pivot.rows.groupby)) {
+ if (_.isEqual(this.search_view_groupby, this.graph_widget.pivot.rows.groupby) ||
+ (!_.has(this.search_view, '_s_groupby'))) {
return;
}
var rows = _.map(this.graph_widget.pivot.rows.groupby, function (group) {
@@ -340,6 +341,9 @@ instance.web_graph.Graph = instance.web.Widget.extend({
var field = header.root.groupby[header.path.length];
this.pivot.expand(id, field);
} else {
+ if (!this.important_fields.length) {
+ return;
+ }
var fields = _.map(this.important_fields, function (field) {
return {id: field, value: self.fields[field].string};
});