diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py index c53732a5942..b0ea24c669b 100644 --- a/addons/website/models/ir_qweb.py +++ b/addons/website/models/ir_qweb.py @@ -50,6 +50,9 @@ class QWeb(models.AbstractModel): atts = super(QWeb, self)._post_processing_att(tagName, atts, options) + if tagName == 'img' and 'loading' not in atts: + atts['loading'] = 'lazy' # default is auto + if options.get('inherit_branding') or options.get('rendering_bundle') or \ options.get('edit_translations') or options.get('debug') or (request and request.session.debug): return atts diff --git a/addons/website/tests/test_qweb.py b/addons/website/tests/test_qweb.py index 7b7d08ded8d..9714a1a2300 100644 --- a/addons/website/tests/test_qweb.py +++ b/addons/website/tests/test_qweb.py @@ -50,15 +50,15 @@ class TestQweb(TransactionCaseWithUserDemo):
-
-
+
+
x
x
xxx