diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-02-20 12:15:24 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-02-20 12:44:19 +0100 |
| commit | 5e936c111bce2a0a5273e0efec0362cb5415a76f (patch) | |
| tree | fe25a0767b7cbbbcf9a487a1c6b130be4b868fc8 /addons/web/static/src | |
| parent | 5446d4ef6c00ef9b8b47e44417a640a48a3e3de8 (diff) | |
[FIX] Web: view_pivot.js: download table with one measure
The headers array contains 2 sub-arrays, whatever the number of
measures. The test on nbr_measures was thus incorrect and produced an
error when downloading a table with a single measure.
Also fix the typo in dow(n)load_table function name.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_pivot.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web/static/src/js/view_pivot.js b/addons/web/static/src/js/view_pivot.js index c76893a4938..1f12347fb42 100644 --- a/addons/web/static/src/js/view_pivot.js +++ b/addons/web/static/src/js/view_pivot.js @@ -71,7 +71,7 @@ instance.web.PivotView = instance.web.View.extend({ self.sidebar.appendTo(self.$sidebar); self.sidebar.add_items('other', [{ label: _t("Download xls"), - callback: self.dowload_table.bind(self) + callback: self.download_table.bind(self) }]); } }); @@ -199,7 +199,7 @@ instance.web.PivotView = instance.web.View.extend({ return this.toggle_measure(field); } if ($target.hasClass('oe-pivot-download')) { - return this.dowload_table(); + return this.download_table(); } }, on_open_header_click: function (event) { @@ -731,7 +731,7 @@ instance.web.PivotView = instance.web.View.extend({ this.load_data().then(this.display_table.bind(this)); } }, - dowload_table: function () { + download_table: function () { openerp.web.blockUI(); var nbr_measures = this.active_measures.length, headers = this.compute_headers(), @@ -754,7 +754,7 @@ instance.web.PivotView = instance.web.View.extend({ } } var table = { - headers: nbr_measures > 1 ? _.initial(headers) : headers, + headers: _.initial(headers), measure_row: measure_row, rows: rows, nbr_measures: nbr_measures, |
