diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index d936791d6a4..7ee972e095b 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -850,10 +850,15 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ // ---------------------------------------------------------------------- export_xls: function() { var c = openerp.webclient.crashmanager; + var table = this.build_table(true); + if(table.measure_row.length + 1 > 256) { + c.show_message(_t("For Excel compatibility, data cannot be exported if there is more than 256 columns.\n\nTip: try to flip axis, filter further or reduce the number of measures.")) + return; + } openerp.web.blockUI(); this.session.get_file({ url: '/web_graph/export_xls', - data: {data: JSON.stringify(this.build_table(true))}, + data: {data: JSON.stringify(table)}, complete: openerp.web.unblockUI, error: c.rpc_error.bind(c) });