summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/ajax.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-08-10 11:36:49 +0200
committerqsm-odoo <qsm@odoo.com>2017-08-10 15:22:20 +0200
commitfdc8bc171108c6d97b9f73ad9dc5ebeea1860d56 (patch)
tree56bd0edf4e8f0cbfd097932c6f05c9472d6bdbb6 /addons/web/static/src/js/core/ajax.js
parent6d3acf6d4a368f0f90f34868b9ce79210817aa9f (diff)
[FIX] web: resolve `ajax.loadXML` deferred at the proper time
There was a problem with the new `ajax.loadXML` implementation introduced with 417a664f16abc67bee40a0067103f9cf2c412aed Indeed the following case was buggy: ``` ajax.loadXML('URL1', qweb); ajax.loadXML().then(function () { ajax.loadXML('URL2', qweb); }); ``` With this code, 'URL2' is scheduled to be loaded when 'URL1' is fully loaded. The problem is that the deferred returned by the call to `ajax.loadXML` without argument was resolved before the internal `isLoading` variable was reset to `false`. So, the loading of 'URL2' was indeed scheduled when 'URL1' was fully loaded but its loading never started because the `ajax.loadXML` loading loop was still marked as running (so it was not started again as it should have been).
Diffstat (limited to 'addons/web/static/src/js/core/ajax.js')
-rw-r--r--addons/web/static/src/js/core/ajax.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/ajax.js b/addons/web/static/src/js/core/ajax.js
index b56823c4e6f..63ee1f47c40 100644
--- a/addons/web/static/src/js/core/ajax.js
+++ b/addons/web/static/src/js/core/ajax.js
@@ -426,8 +426,8 @@ var loadXML = (function () {
} else {
// There is nothing to load anymore, so resolve the
// "all the calls" deferred
- allLoadingsDef.resolve();
isLoading = false;
+ allLoadingsDef.resolve();
}
}
};