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)