diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-02-05 14:14:06 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-02-05 14:14:06 +0100 |
| commit | d0961eb09ecd2db3e155fd66b0c059ddbb30f992 (patch) | |
| tree | d7454acd3e25dc3d6d84bc9d488d6ec5ff911e83 /addons/web_graph/static/src | |
| parent | 19d6d98da83d9cb19d66741ed9377647ac34f762 (diff) | |
[FIX] many small tweaks, add some comment, rename variables to have better more informative names in excel export functionality in graph view (addon web_graph)
bzr revid: ged@openerp.com-20140205131406-kdw5ht9u8gct9xbo
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph_widget.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 79d814460df..51baabaff5e 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -25,6 +25,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ this.bar_ui = options.bar_ui || 'group'; this.graph_view = options.graph_view || null; this.pivot_options = options; + this.title = options.title || 'Data'; }, start: function() { @@ -40,7 +41,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ } openerp.session.rpc('/web_graph/check_xlwt').then(function (result) { - if (result) { self.$('.graph_options_selection label').toggle(true); } + self.$('.graph_options_selection label').toggle(result); }); return this.model.call('fields_get', []).then(function (f) { @@ -371,7 +372,8 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ headers: this.build_headers(), measure_row: this.build_measure_row(), rows: this.build_rows(), - nbr_measures: this.pivot.measures.length + nbr_measures: this.pivot.measures.length, + title: this.title, }; }, @@ -394,10 +396,10 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ }); if (pivot.get_cols_leaves().length > 1) { - rows[0].push({width:nbr_measures, height:height, title: _t('Total'), id: pivot.cols.headers[0].id }); + rows[0].push({width: nbr_measures, height: height, title: _t('Total'), id: pivot.main_col().id }); } if (pivot.cols.headers.length === 1) { - rows = [[{width:nbr_measures, height:1, title: _t('Total'), id: pivot.cols.headers[0].id, expanded: false}]]; + rows = [[{width: nbr_measures, height: 1, title: _t('Total'), id: pivot.main_col().id, expanded: false}]]; } return rows; }, |
