diff options
| author | Mohammed Shekha <msh@odoo.com> | 2019-11-25 11:05:07 +0000 |
|---|---|---|
| committer | Mohammed Shekha <msh@odoo.com> | 2020-01-28 09:00:29 +0000 |
| commit | c40c11761d04915b4950d0be63432cc7f70fb4fc (patch) | |
| tree | 3850517337dc27f3fd11b021bdc69d691a8a1149 /addons/web/static/src | |
| parent | 62ae169dfb878d3cbd06f6926e761928cc9388cf (diff) | |
[IMP] web: change pivot download file from xls to xlsx
before this commit: file was downloaded in xls format, which supports
maximum 256 columns and 65536 rows.
after this commit: pivot returns xlsx file when table printed and
downloaded, we have support of xlsxwriter, xlsx file supports 16384
columns and 1048576 rows
task-2127388
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_controller.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_controller.js b/addons/web/static/src/js/views/pivot/pivot_controller.js index e1c33a53fec..c54c6affedc 100644 --- a/addons/web/static/src/js/views/pivot/pivot_controller.js +++ b/addons/web/static/src/js/views/pivot/pivot_controller.js @@ -111,21 +111,21 @@ odoo.define('web.PivotController', function (require) { /** * Export the current pivot table data in a xls file. For this, we have to - * serialize the current state, then call the server /web/pivot/export_xls. + * serialize the current state, then call the server /web/pivot/export_xlsx. * Force a reload before exporting to ensure to export up-to-date data. * * @private */ _downloadTable: function () { - if (this.model.getTableWidth() > 256) { - this.call('crash_manager', 'show_message', _t("For Excel compatibility, data cannot be exported if there are more than 256 columns.\n\nTip: try to flip axis, filter further or reduce the number of measures.")); + if (this.model.getTableWidth() > 16384) { + this.call('crash_manager', 'show_message', _t("For Excel compatibility, data cannot be exported if there are more than 16384 columns.\n\nTip: try to flip axis, filter further or reduce the number of measures.")); framework.unblockUI(); return; } const table = this.model.exportData(); table.title = this.title; session.get_file({ - url: '/web/pivot/export_xls', + url: '/web/pivot/export_xlsx', data: { data: JSON.stringify(table) }, complete: framework.unblockUI, error: (error) => this.call('crash_manager', 'rpc_error', error), diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 64d7783acab..c64ff163364 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -548,7 +548,7 @@ <div class="btn-group" role="toolbar" aria-label="Pivot settings"> <button class="btn btn-secondary fa fa-exchange o_pivot_flip_button" title="Flip axis" aria-label="Flip axis"/> <button class="btn btn-secondary fa fa-arrows o_pivot_expand_button" title="Expand all" aria-label="Expand all"/> - <button class="btn btn-secondary fa fa-download o_pivot_download" title="Download xls" aria-label="Download xls"/> + <button class="btn btn-secondary fa fa-download o_pivot_download" title="Download xlsx" aria-label="Download xlsx"/> </div> </t> |
