From 7dfdfa0103872e39d6fde60373c56b9786461489 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 13 Dec 2017 10:54:14 +0100 Subject: [PATCH] [FIX] web_editor: Avoid twice translated for static xml Avoid texts to be translated twice if some modules have the translated value corresponding to the English source term. To reproduce: create a translation for static xml (comment 'openerp-web') with 'Modifier' translated by 'Tadaaa'. In french context, the 'Edit' button in forms is translated by 'Tadaaa'. Don't translate template in web_editor if we are in the backend because the translations of all the modules have already been loaded and applied. --- addons/web_editor/static/src/js/base.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/base.js b/addons/web_editor/static/src/js/base.js index f65ecaa7c02..f7245f6689d 100644 --- a/addons/web_editor/static/src/js/base.js +++ b/addons/web_editor/static/src/js/base.js @@ -32,7 +32,10 @@ data.dom_ready = dom_ready; var all_ready; data.ready = function () { if (!all_ready) { - all_ready = $.when(dom_ready, ajax.loadXML()).then(translations); + all_ready = $.when(dom_ready, ajax.loadXML()); + if (!odoo._modules) { + all_ready.then(translations); + } } else if(all_ready.state() === "resolved") { // can add async template all_ready = $.when(dom_ready, ajax.loadXML()); }