summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/pivot_view.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-01-27 12:23:09 +0100
committerChristophe Simonis <chs@odoo.com>2016-01-27 12:23:09 +0100
commit7e44ddcda3f21c7e6401173539dc0fe93f9a7dd2 (patch)
tree322d7f2ce86ce328c27197c5c1b31c9f4a2b2c5c /addons/web/static/src/js/views/pivot_view.js
parent3c7b08c030daf84323279b3d87361214e4f1b729 (diff)
parent6f923cbdcdc9a78d1999999b3bbd917eb8b4e921 (diff)
[MERGE] forward port of branch saas-7 up to 6f923cb
Diffstat (limited to 'addons/web/static/src/js/views/pivot_view.js')
-rw-r--r--addons/web/static/src/js/views/pivot_view.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/pivot_view.js b/addons/web/static/src/js/views/pivot_view.js
index deb2c16870f..6d0a75da569 100644
--- a/addons/web/static/src/js/views/pivot_view.js
+++ b/addons/web/static/src/js/views/pivot_view.js
@@ -17,7 +17,6 @@ var View = require('web.View');
var _lt = core._lt;
var _t = core._t;
var QWeb = core.qweb;
-var total = _t("Total");
var PivotView = View.extend({
template: 'PivotView',
@@ -184,7 +183,7 @@ var PivotView = View.extend({
}
}
});
- this.measures.__count__ = {string: "Quantity", type: "integer"};
+ this.measures.__count__ = {string: _t("Quantity"), type: "integer"};
},
do_search: function (domain, context, group_by) {
if (!this.ready) {
@@ -509,6 +508,7 @@ var PivotView = View.extend({
return name + (numbers[id] > 1 ? " (" + numbers[id] + ")" : "");
},
make_header: function (data_pt, root, i, j, parent_header) {
+ var total = _t("Total");
var attrs = data_pt.attributes,
value = attrs.value,
title = value.length ? value[value.length - 1] : total;
@@ -537,6 +537,7 @@ var PivotView = View.extend({
},
get_header: function (data_pt, root, i, j, parent) {
var path;
+ var total = _t("Total");
if (parent) {
path = parent.path.concat(data_pt.attributes.value.slice(i,j));
} else {
@@ -798,6 +799,10 @@ var PivotView = View.extend({
nbr_measures: nbr_measures,
title: this.title,
};
+ 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;
+ }
session.get_file({
url: '/web/pivot/export_xls',
data: {data: JSON.stringify(table)},
@@ -834,4 +839,3 @@ core.view_registry.add('pivot', PivotView);
return PivotView;
});
-