From ff3c4944484aaf28b557e650799c4acb2e30e283 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 13 Mar 2018 10:03:37 +0100 Subject: [PATCH] [FIX] web_editor: apply cdn for python qweb widget image issue: widget image doe not pos processing the attributes --- addons/web/models/ir_qweb.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/addons/web/models/ir_qweb.py b/addons/web/models/ir_qweb.py index 5c94da64d53..0a5e0deb4e9 100644 --- a/addons/web/models/ir_qweb.py +++ b/addons/web/models/ir_qweb.py @@ -2,6 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import hashlib +from collections import OrderedDict from odoo import api, models from odoo.tools import pycompat @@ -56,6 +57,24 @@ class Image(models.AbstractModel): elif options.get('zoom'): src_zoom = options['zoom'] - img = '' % \ - (classes, src, options.get('style', ''), ' alt="%s"' % alt if alt else '', ' data-zoom="1" data-zoom-image="%s"' % src_zoom if src_zoom else '') - return pycompat.to_text(img) + atts = OrderedDict() + atts["src"] = src + atts["class"] = classes + atts["style"] = options.get('style') + atts["alt"] = alt + atts["data-zoom"] = src_zoom and u'1' or None + atts["data-zoom-image"] = src_zoom + + atts = self.env['ir.qweb']._post_processing_att('img', atts, options) + + img = ['') + + return u''.join(img)