[IMP] web: add support for itemprop on img

Take the following QWeb snippet:

```
<div t-field="product.image" itemprop="image" t-options="{'widget': 'image'}"/>
```

When the image is rendered, the `itemprop="image"` remains on the
`<div>` tag, it is not set on the `<img>` tag.

We add the support of the `itemprop` option, so it can be added to the
`<img>` tag:

```
<div t-field="product.image" t-options="{'widget': 'image', 'itemprop': 'image'}"/>
```

opw-2076934
This commit is contained in:
Nicolas Martinelli
2019-10-08 08:17:05 +00:00
parent e42aa1e344
commit 030f2654a5
+5
View File
@@ -69,8 +69,13 @@ class Image(models.AbstractModel):
elif options.get('zoom'):
src_zoom = options['zoom']
itemprop = None
if options.get('itemprop'):
itemprop = options['itemprop']
atts = OrderedDict()
atts["src"] = src
atts["itemprop"] = itemprop
atts["class"] = classes
atts["style"] = options.get('style')
atts["alt"] = alt