diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-08-29 16:07:03 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-08-29 16:07:03 +0200 |
| commit | 6c6ba6c78afc57b8808b2b11e92b11c9be3375ff (patch) | |
| tree | 80e4e5d82b6094ad4d76700ae7e4ebfde4d91a27 /addons/web/controllers/main.py | |
| parent | ccfc4e7026e2ab03a2adda526f890ca810e0da70 (diff) | |
| parent | 81908899fc49af3bdbd41f3869c96d4fe2651811 (diff) | |
[MERGE] forward port branch 9.0 up to 81908899fc4
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 1f97a1f3be8..c546981b504 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -35,7 +35,7 @@ from openerp.tools import ustr from openerp.tools.misc import str2bool, xlwt from openerp import http from openerp.http import request, serialize_exception as _serialize_exception, content_disposition -from openerp.exceptions import AccessError +from openerp.exceptions import AccessError, UserError _logger = logging.getLogger(__name__) @@ -1405,6 +1405,9 @@ class ExcelExport(ExportFormat, http.Controller): return base + '.xls' def from_data(self, fields, rows): + if len(rows) > 65535: + raise UserError(_('There are too many rows (%s rows, limit: 65535) to export as Excel 97-2003 (.xls) format. Consider splitting the export.') % len(rows)) + workbook = xlwt.Workbook() worksheet = workbook.add_sheet('Sheet 1') |
