From fdf0f014bf1f42d72ee57161a7a343bb2b7cd9a2 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 14 Dec 2017 11:42:10 +0100 Subject: [PATCH] [FIX] web: avoid race condition in the website Depending on the speed of the runbot, errors may appear if one tries to use a template that is not yet loaded. Templates are being loaded and we add new template to read, the ready function does not take into account new additions. --- addons/web_editor/static/src/js/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/base.js b/addons/web_editor/static/src/js/base.js index f7245f6689d..7bf9c2aa641 100644 --- a/addons/web_editor/static/src/js/base.js +++ b/addons/web_editor/static/src/js/base.js @@ -36,7 +36,7 @@ data.ready = function () { if (!odoo._modules) { all_ready.then(translations); } - } else if(all_ready.state() === "resolved") { // can add async template + } else { // can add async template all_ready = $.when(dom_ready, ajax.loadXML()); } return all_ready;