diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-24 11:09:42 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-24 11:09:42 +0100 |
| commit | db9cdb7eb0c7c6e8a26c89fd314dd016d8f8ab03 (patch) | |
| tree | ce43eac2b22aa36782ea94fbbb9934a766daaf4a /addons/web_graph/static/src/js | |
| parent | e844ba1040aa3ea52792324272e3a39a9df2ea6e (diff) | |
[IMP] makes some small changes to improves backward compatibility in some edge cases (takes the first 'operator' as a measure instead of the last, ...) in graph view (addon web_graph)
bzr revid: ged@openerp.com-20131224100942-jnrdjeb9lg7rx8d2
Diffstat (limited to 'addons/web_graph/static/src/js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index b966a38e898..991b21980e6 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -76,7 +76,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ } } else { // old style, kept for backward compatibility if ('operator' in field.attrs) { - measure = field.attrs.name; + measure = (measure) ? measure : field.attrs.name; } else { self.default_row_groupby.push(field.attrs.name); } @@ -95,6 +95,12 @@ instance.web_graph.GraphView = instance.web.View.extend({ options = {domain:domain}; this.search_view_groupby = group_by; + + if (group_by.length && this.groupby_mode !== 'manual') { + if (_.isEqual(col_groupby, [])) { + col_groupby = this.default_col_groupby; + } + } if (group_by.length || col_groupby.length) { this.groupby_mode = 'manual'; } @@ -243,7 +249,6 @@ instance.web_graph.Graph = instance.web.Widget.extend({ .attr('href', '#') .append(self.fields[measure].string); measure_selection.append($('<li></li>').append(choice)); - }); }); @@ -572,7 +577,6 @@ instance.web_graph.Graph = instance.web.Widget.extend({ nv.addGraph(function () { var chart = nv.models.multiBarChart() - .tooltips(false) .width(self.width) .height(self.height) .stacked(self.bar_ui === 'stack') |
