[FIX] web: translation in pivot view
The definition of "total" as a global variable is done too soon in the JS. Depending on the order in which the JS modules are loaded, it is very unlikely that the translations are already loaded at that moment. opw-666577
This commit is contained in:
@@ -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',
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user