summaryrefslogtreecommitdiff
path: root/addons/web/static/lib
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-03-09 16:25:58 +0100
committerChristophe Simonis <chs@odoo.com>2018-03-09 16:25:58 +0100
commit0f57bdba72b592ca097d4cd3da99a75883d8c623 (patch)
tree94eef0c9aaf885c7f717bab5e468ca72b59a219d /addons/web/static/lib
parent35f0797002e44ce5673e9fab63710d2764329694 (diff)
parent42659dc70c2b9b124e7e4fdc0449f660c3de5c76 (diff)
[MERGE] forward port branch saas-11.2 up to 42659dc70c2
Diffstat (limited to 'addons/web/static/lib')
-rw-r--r--addons/web/static/lib/qweb/qweb2.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js
index c4bb7128e9b..94a0afaa32a 100644
--- a/addons/web/static/lib/qweb/qweb2.js
+++ b/addons/web/static/lib/qweb/qweb2.js
@@ -358,7 +358,12 @@ QWeb2.Engine = (function() {
req.open('GET', s, async);
if (async) {
req.addEventListener("load", function() {
- if (req.status == 200) {
+ // 0, not being a valid HTTP status code, is used by browsers
+ // to indicate success for a non-http xhr response
+ // (for example, using the file:// protocol)
+ // https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=331610
+ if (req.status == 200 || req.status == 0) {
callback(null, self._parse_from_request(req));
} else {
callback(new Error("Can't load template " + s + ", http status " + req.status));