<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/models/ir_qweb.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[IMP] base,web: add image_url widget support in qweb.</title>
<updated>2020-09-03T08:40:30+00:00</updated>
<author>
<name>Victor Feyens</name>
<email>vfe@odoo.com</email>
</author>
<published>2020-09-02T08:50:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=310fb4b7c5e2a6205b59de76356f14c3d562cee9'/>
<id>310fb4b7c5e2a6205b59de76356f14c3d562cee9</id>
<content type='text'>
The new "image_url" widget logic provides the ability to provide static image
links in Char fields instead of duplicating the image file in database (+ filestore)
through an Image field (&amp; ir_attachment).

This commits implements the frontend qweb logic for this widget, following the logic
of the existing "image" qweb widget.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new "image_url" widget logic provides the ability to provide static image
links in Char fields instead of duplicating the image file in database (+ filestore)
through an Image field (&amp; ir_attachment).

This commits implements the frontend qweb logic for this widget, following the logic
of the existing "image" qweb widget.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: fix image widget when record name is ..</title>
<updated>2020-08-06T15:07:37+00:00</updated>
<author>
<name>Patrick Hoste</name>
<email>pko@odoo.com</email>
</author>
<published>2020-06-04T12:13:16+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8c0bc4f4b81db820fe984ebc4d209894a8041f39'/>
<id>8c0bc4f4b81db820fe984ebc4d209894a8041f39</id>
<content type='text'>
PURPOSE

Before this commit, when you used the 'image' widget when the record name was
``..`` (double dots) it couldn't retrieve the image since the double dots was
decoded as the parent directory shortcut. After this commit, the double dots
will be replaced by -- with the downside to loose the true record name.

SPECIFICATIONS

Replace the .. (double dots) with -- in the filename.

Using .. may seem like a strange use case but if you actually try to find
a partner called ".." in a production database, you might be surprised ...

LINKS

Task ID-2241513 (eLearning onboarding and testing)
PR #55567

X-original-commit: dcb7a924c36cd3f3aeef891ddd8830bd66322025</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Before this commit, when you used the 'image' widget when the record name was
``..`` (double dots) it couldn't retrieve the image since the double dots was
decoded as the parent directory shortcut. After this commit, the double dots
will be replaced by -- with the downside to loose the true record name.

SPECIFICATIONS

Replace the .. (double dots) with -- in the filename.

Using .. may seem like a strange use case but if you actually try to find
a partner called ".." in a production database, you might be surprised ...

LINKS

Task ID-2241513 (eLearning onboarding and testing)
PR #55567

X-original-commit: dcb7a924c36cd3f3aeef891ddd8830bd66322025</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch 13.0 up to f4105eb9c70</title>
<updated>2019-10-09T00:08:17+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-10-09T00:08:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d74b4518052066446e2a1975a91ce53c745ca75a'/>
<id>d74b4518052066446e2a1975a91ce53c745ca75a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: add support for itemprop on img</title>
<updated>2019-10-08T08:17:05+00:00</updated>
<author>
<name>Nicolas Martinelli</name>
<email>nim@odoo.com</email>
</author>
<published>2019-10-03T10:12:42+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=030f2654a5c472229d20e283072bd76a5b1439cc'/>
<id>030f2654a5c472229d20e283072bd76a5b1439cc</id>
<content type='text'>
Take the following QWeb snippet:

```
&lt;div t-field="product.image" itemprop="image" t-options="{'widget': 'image'}"/&gt;
```

When the image is rendered, the `itemprop="image"` remains on the
`&lt;div&gt;` tag, it is not set on the `&lt;img&gt;` tag.

We add the support of the `itemprop` option, so it can be added to the
`&lt;img&gt;` tag:

```
&lt;div t-field="product.image" t-options="{'widget': 'image', 'itemprop': 'image'}"/&gt;
```

opw-2076934</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Take the following QWeb snippet:

```
&lt;div t-field="product.image" itemprop="image" t-options="{'widget': 'image'}"/&gt;
```

When the image is rendered, the `itemprop="image"` remains on the
`&lt;div&gt;` tag, it is not set on the `&lt;img&gt;` tag.

We add the support of the `itemprop` option, so it can be added to the
`&lt;img&gt;` tag:

```
&lt;div t-field="product.image" t-options="{'widget': 'image', 'itemprop': 'image'}"/&gt;
```

opw-2076934</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: upgrade the cache to use SHA2 over SHA1</title>
<updated>2019-09-04T09:52:01+00:00</updated>
<author>
<name>Julien Castiaux</name>
<email>juc@odoo.com</email>
</author>
<published>2019-09-04T09:52:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b96e633b0b8d04d374fde1e5c761213b47d8f2e9'/>
<id>b96e633b0b8d04d374fde1e5c761213b47d8f2e9</id>
<content type='text'>
SHA-1 is a cryptographic hash function that have weaknesses known since
2005, it has been deprecated by the NIST [1] about 10 years ago in 2011
and Google [2] have been able to perform a collision attack in 2017.

We use SHA-1 in order to generate unique URL for resources that can be
cached by the browser: assets bundle, translations, qweb templates and
qweb images.

Although practical attacks still requires quite a lot of computational
resources, it is time to upgrade SHA-1 to SHA-2.

We have selected the SHA-512/256 variant of the SHA-2 algorithm as
replacement for SHA-1 for the following reasons:

* On 64 bits platform, SHA-512 is the fastest SHA-2 variant, it is only
  ~1.5x slower than SHA-1. [3]
* Keeping only the 256 foremost bits protects against both collision
  attacks and length extension attacks.
* The hexadecimal digest is only 24 chars longer than SHA-1 which is
  nice to have somewhat short URLs.

We have not used SHA-3 because:

* At the moment of writing, it is too slow (~3x slower than SHA-1) [3]
* It is not guaranteed to be available with the Python 3.5 `hashlib`
  module.
* One of the author of SHA-3 is Belgian.

[1] https://csrc.nist.gov/projects/hash-functions/nist-policy-on-hash-functions
[2] https://shattered.io/
[3] http://bench.cr.yp.to/results-hash.html
[4] http://www.commitstrip.com/en/2017/02/27/the-sha-1-alternative/</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SHA-1 is a cryptographic hash function that have weaknesses known since
2005, it has been deprecated by the NIST [1] about 10 years ago in 2011
and Google [2] have been able to perform a collision attack in 2017.

We use SHA-1 in order to generate unique URL for resources that can be
cached by the browser: assets bundle, translations, qweb templates and
qweb images.

Although practical attacks still requires quite a lot of computational
resources, it is time to upgrade SHA-1 to SHA-2.

We have selected the SHA-512/256 variant of the SHA-2 algorithm as
replacement for SHA-1 for the following reasons:

* On 64 bits platform, SHA-512 is the fastest SHA-2 variant, it is only
  ~1.5x slower than SHA-1. [3]
* Keeping only the 256 foremost bits protects against both collision
  attacks and length extension attacks.
* The hexadecimal digest is only 24 chars longer than SHA-1 which is
  nice to have somewhat short URLs.

We have not used SHA-3 because:

* At the moment of writing, it is too slow (~3x slower than SHA-1) [3]
* It is not guaranteed to be available with the Python 3.5 `hashlib`
  module.
* One of the author of SHA-3 is Belgian.

[1] https://csrc.nist.gov/projects/hash-functions/nist-policy-on-hash-functions
[2] https://shattered.io/
[3] http://bench.cr.yp.to/results-hash.html
[4] http://www.commitstrip.com/en/2017/02/27/the-sha-1-alternative/</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch saas-12.3 up to 50e571acf7c</title>
<updated>2019-09-11T09:39:33+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-09-11T09:39:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=51354fadb0a1bf5fa797c2539e703cf97d768691'/>
<id>51354fadb0a1bf5fa797c2539e703cf97d768691</id>
<content type='text'>
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: correctly escape image name</title>
<updated>2019-09-02T19:15:46+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-29T12:29:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3a52b22b503f5a9b42be779a0a92ecd39721363b'/>
<id>3a52b22b503f5a9b42be779a0a92ecd39721363b</id>
<content type='text'>
Follow up of https://github.com/odoo/odoo/commit/2f932e3a46c6005870e4130b3c3f7151cd521f2d#r34760948

`url_quote` does not escape `/` which leads to incorrect routes when the name
contains `/`.

Also escape `\` to avoid potential issues on different OS.

closes odoo/odoo#36146

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of https://github.com/odoo/odoo/commit/2f932e3a46c6005870e4130b3c3f7151cd521f2d#r34760948

`url_quote` does not escape `/` which leads to incorrect routes when the name
contains `/`.

Also escape `\` to avoid potential issues on different OS.

closes odoo/odoo#36146

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools,base,web,website_*: keep image ratio on resize</title>
<updated>2019-04-29T13:45:03+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-04-26T10:55:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d870877967b5debc11d9364ba1572e7aa6956c28'/>
<id>d870877967b5debc11d9364ba1572e7aa6956c28</id>
<content type='text'>
* = website_partner, website_profile, website_sale, website_slides

Before
======

Since commit: 2e3848b394748bf23eff0db0d6d92b9e8c9bf875

The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.

With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.

Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.

It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.

After
=====

This commit will solve all of those problems by always keeping the ratio of the
original image.

This implies the views should be taking care of adding borders when necessary.

task-1958000
PR: #31811</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* = website_partner, website_profile, website_sale, website_slides

Before
======

Since commit: 2e3848b394748bf23eff0db0d6d92b9e8c9bf875

The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.

With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.

Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.

It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.

After
=====

This commit will solve all of those problems by always keeping the ratio of the
original image.

This implies the views should be taking care of adding borders when necessary.

task-1958000
PR: #31811</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: add filename to qweb image widget</title>
<updated>2019-03-08T15:41:52+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-03-08T15:41:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2f932e3a46c6005870e4130b3c3f7151cd521f2d'/>
<id>2f932e3a46c6005870e4130b3c3f7151cd521f2d</id>
<content type='text'>
It's better to always have a relevant name in the image URL for SEO.

Also make sure there is always an alt on the image.

closes odoo/odoo#31705

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's better to always have a relevant name in the image URL for SEO.

Also make sure there is always an alt on the image.

closes odoo/odoo#31705

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: allow preview_image option for image widget of qweb field</title>
<updated>2019-02-14T16:03:08+00:00</updated>
<author>
<name>Dharmraj Jhala</name>
<email>dja@odoo.com</email>
</author>
<published>2019-02-11T16:06:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=38843624d42c284a194a854c467190d69b4169ab'/>
<id>38843624d42c284a194a854c467190d69b4169ab</id>
<content type='text'>
With this option we can define which field is going to be displayed by the qweb
image widget, while logic is still applied to the original field.

For example, we want to show a thumbnail image but when user updates it with the
web editor, we want to update the actual field instead of the thumbnail field.

This is similar to the preview_image of the JS image widget.

task-34045
PR: #30656</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this option we can define which field is going to be displayed by the qweb
image widget, while logic is still applied to the original field.

For example, we want to show a thumbnail image but when user updates it with the
web editor, we want to update the actual field instead of the thumbnail field.

This is similar to the preview_image of the JS image widget.

task-34045
PR: #30656</pre>
</div>
</content>
</entry>
</feed>
