diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-10 12:16:46 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-10 12:16:46 +0100 |
| commit | 1419b0793939de96bf67fc2e48d05a4fc55773d7 (patch) | |
| tree | 5c9e9c4d939ca2d2e15de2c81f757219b9cab987 /addons/web_graph/static/src/js | |
| parent | fe5543a04335aa9a58dad3654318341776fe9e3e (diff) | |
[IMP] improves the way the chart view understands the xml descr of the view, so that nows fields after the operator = + are considered col groupbys (addon web_graph)
bzr revid: ged@openerp.com-20131210111646-9d8l78npv72pqfp8
Diffstat (limited to 'addons/web_graph/static/src/js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index d64918aee56..e35b8516dd4 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -43,6 +43,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ this.search_view = parent.searchview; this.groupby_mode = 'default'; // 'default' or 'manual' this.default_row_groupby = []; + this.default_col_groupby = []; this.search_field = { get_context: this.proxy('get_context'), get_domain: function () {}, @@ -83,7 +84,11 @@ instance.web_graph.GraphView = instance.web.View.extend({ if ('operator' in field.attrs) { self.measure_list.push(field.attrs.name); } else { - self.default_row_groupby.push(field.attrs.name); + if (self.measure_list.length) { + self.default_col_groupby.push(field.attrs.name); + } else { + self.default_row_groupby.push(field.attrs.name); + } } } }); @@ -139,7 +144,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ this.pivot_table.set_col_groupby(col_groupby); } else { this.pivot_table.set_row_groupby(_.toArray(this.default_row_groupby)); - this.pivot_table.set_col_groupby([]); + this.pivot_table.set_col_groupby(_.toArray(this.default_col_groupby)); } this.display_data(); }, |
