diff --git a/addons/test_website/tests/test_qweb.py b/addons/test_website/tests/test_qweb.py index aab35f16da1..e498232e09a 100644 --- a/addons/test_website/tests/test_qweb.py +++ b/addons/test_website/tests/test_qweb.py @@ -62,7 +62,7 @@ class TestQweb(TransactionCaseWithUserDemo): - +
diff --git a/addons/web/static/src/boot.js b/addons/web/static/src/boot.js
index 22d71a145bd..438d2e485d1 100644
--- a/addons/web/static/src/boot.js
+++ b/addons/web/static/src/boot.js
@@ -406,6 +406,15 @@
}
function displayModuleErrors({ failed, missing, unloaded, cycle }) {
+ if (window.__odooAssetError) {
+ // this flag is set when we have an error loading the script for an
+ // asset. We sometimes see a 404, probably due to the fact that the
+ // attachment has been deleted. It is unclear in which circumstances
+ // it can happen, but we sometimes observe it. We could here force a
+ // reload, but it seems dangerous, since in case of errors, this
+ // could easily lead to an infinite loop.
+ return;
+ }
const list = (heading, arr) => {
const frag = document.createDocumentFragment();
if (!arr || !arr.length) {
diff --git a/odoo/addons/base/models/assetsbundle.py b/odoo/addons/base/models/assetsbundle.py
index 2eca5ec3d7a..e7983615773 100644
--- a/odoo/addons/base/models/assetsbundle.py
+++ b/odoo/addons/base/models/assetsbundle.py
@@ -196,6 +196,7 @@ class AssetsBundle(object):
["data-src" if lazy_load else "src", src],
['data-asset-bundle', self.name],
['data-asset-version', self.version],
+ ['onerror', '__odooAssetError=1']
])
response.append(("script", attr, None))
diff --git a/odoo/addons/test_assetsbundle/tests/test_assetsbundle.py b/odoo/addons/test_assetsbundle/tests/test_assetsbundle.py
index 0937ff1f2cb..5c8a96ca0aa 100644
--- a/odoo/addons/test_assetsbundle/tests/test_assetsbundle.py
+++ b/odoo/addons/test_assetsbundle/tests/test_assetsbundle.py
@@ -624,7 +624,7 @@ class TestJavascriptAssetsBundle(FileTouchable):
-
+
@@ -655,7 +655,7 @@ class TestJavascriptAssetsBundle(FileTouchable):
-
+