From b22a22f81180e1515d295aa4d7c8bf176c653ef2 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 25 Jan 2016 13:24:16 +0100 Subject: [PATCH] [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 --- addons/web/static/src/js/views/pivot_view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/pivot_view.js b/addons/web/static/src/js/views/pivot_view.js index f2238fcccb9..7c74103f211 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', @@ -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 {