<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/models, 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>[FIX] web: fix kanban view progressbars related to records in another group (groupby:week)</title>
<updated>2021-05-06T09:19:07+00:00</updated>
<author>
<name>abd-msyukyu-odoo</name>
<email>abd@odoo.com</email>
</author>
<published>2021-04-27T14:43:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=665e9538005832b557f30f7a6663b25cf3e7c169'/>
<id>665e9538005832b557f30f7a6663b25cf3e7c169</id>
<content type='text'>
* IMPACTED VERSIONS

  12.0+

* HOW TO REPRODUCE

locale :  Locale is en_US (or other SUNDAY based)
view:     CRM - My Pipeline - Kanban view
groupBy:  date_deadline:week (Expected closing)
records:  one record with a planned activity, on date_deadline = 2021-05-02 (SUNDAY)
          one record with no planned activity, on date_deadline = 2021-05-09 (SUNDAY)
remark:   don't keep any other record in MAY for better visibility

* PROBLEM

The progressbar of the week containing 2021-05-09 displays information about the record
from the week containing 2021-05-02

* CAUSE

1. PostgreSQL `date_trunc` function follows ISO8601 which essentially means that
  the start of a WEEK is always MONDAY. There is no argument to change this.

2. _read_group_format_result
  https://github.com/odoo/odoo/blob/27da86a138089c1838e4b94f8a6976995b9c1fff/odoo/models.py#L2210-L2219

  - Computes a label for a group of records.
  - Follows the locale for the label of the week, based on a date which is
    always a MONDAY because of `date_trunc`.

3. read_progress_bar
  https://github.com/odoo/odoo/blob/88957afca09662af7eaa19df1e40b3699e45e79e/addons/web/models/models.py#L167-L175

  - Associates a group label to a record.
  - Follows the locale for the label of the week, based on the date of a record
    which can be any day of the week. If the record is related to a SUNDAY and
    SUNDAY is the first day of the week, it would have been in a group with a
    different label in (2.) than in (3.) prior to this change.

* FIX

In 3., before associating a label to a record, we truncate the date to the
ISO start of the period, so that the label is determined for a record in the
same conditions than in 2. The locale is still used to get language-dependent
outputs with babel, but the grouping will always follows ISO8601 (date_trunc).

* TEST

Added a test for this problem case

TASK-ID : 2517848

closes odoo/odoo#70453

X-original-commit: c08f6e3e9a084944ea711d33b2421f845c560d3f
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* IMPACTED VERSIONS

  12.0+

* HOW TO REPRODUCE

locale :  Locale is en_US (or other SUNDAY based)
view:     CRM - My Pipeline - Kanban view
groupBy:  date_deadline:week (Expected closing)
records:  one record with a planned activity, on date_deadline = 2021-05-02 (SUNDAY)
          one record with no planned activity, on date_deadline = 2021-05-09 (SUNDAY)
remark:   don't keep any other record in MAY for better visibility

* PROBLEM

The progressbar of the week containing 2021-05-09 displays information about the record
from the week containing 2021-05-02

* CAUSE

1. PostgreSQL `date_trunc` function follows ISO8601 which essentially means that
  the start of a WEEK is always MONDAY. There is no argument to change this.

2. _read_group_format_result
  https://github.com/odoo/odoo/blob/27da86a138089c1838e4b94f8a6976995b9c1fff/odoo/models.py#L2210-L2219

  - Computes a label for a group of records.
  - Follows the locale for the label of the week, based on a date which is
    always a MONDAY because of `date_trunc`.

3. read_progress_bar
  https://github.com/odoo/odoo/blob/88957afca09662af7eaa19df1e40b3699e45e79e/addons/web/models/models.py#L167-L175

  - Associates a group label to a record.
  - Follows the locale for the label of the week, based on the date of a record
    which can be any day of the week. If the record is related to a SUNDAY and
    SUNDAY is the first day of the week, it would have been in a group with a
    different label in (2.) than in (3.) prior to this change.

* FIX

In 3., before associating a label to a record, we truncate the date to the
ISO start of the period, so that the label is determined for a record in the
same conditions than in 2. The locale is still used to get language-dependent
outputs with babel, but the grouping will always follows ISO8601 (date_trunc).

* TEST

Added a test for this problem case

TASK-ID : 2517848

closes odoo/odoo#70453

X-original-commit: c08f6e3e9a084944ea711d33b2421f845c560d3f
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: explicitly specify resampling filter when resizing</title>
<updated>2020-10-15T15:25:47+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2020-10-15T12:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1b20c67915e200f34fb975c73b0a5ff6b1d50e58'/>
<id>1b20c67915e200f34fb975c73b0a5ff6b1d50e58</id>
<content type='text'>
Pillow 7.0 changed the default resampling filter from NEAREST to
BICUBIC. Because the logo parser resizes the image before sampling it
and doesn't specify a filter, its behavior changes depending on the
version of Pillow, even if the input image is the same. And there's a
test depending on its output with a fixed image.

Explicitly specify the old default as that's what's in the test.

closes odoo/odoo#60117

X-original-commit: 3dbc0711b65ae47a230bcd8b3348962127bcaf14
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pillow 7.0 changed the default resampling filter from NEAREST to
BICUBIC. Because the logo parser resizes the image before sampling it
and doesn't specify a filter, its behavior changes depending on the
version of Pillow, even if the input image is the same. And there's a
test depending on its output with a fixed image.

Explicitly specify the old default as that's what's in the test.

closes odoo/odoo#60117

X-original-commit: 3dbc0711b65ae47a230bcd8b3348962127bcaf14
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: do not crash if uploading a grayscale image</title>
<updated>2020-10-08T09:26:53+00:00</updated>
<author>
<name>Nicolas Galler</name>
<email>ngl@odoo.com</email>
</author>
<published>2020-10-06T12:43:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6d6e48f34f850fa533ce00532ada0e3464c8144b'/>
<id>6d6e48f34f850fa533ce00532ada0e3464c8144b</id>
<content type='text'>
Behavior before the fix:

Uploading a grayscale image with transparency in the company logo field
of the document layout causes a crash:

```
  File "/data/build/odoo/addons/web/models/base_document_layout.py", line 89, in _compute_logo_colors
    wizard.logo_primary_color, wizard.logo_secondary_color = wizard_for_image._parse_logo_colors()
  File "/data/build/odoo/addons/web/models/base_document_layout.py", line 191, in _parse_logo_colors
    color[1][2] &gt; white_threshold) and color[1][3] &gt; 0:
Exception

...
IndexError: tuple index out of range
```

To reproduce, use the `logo_ci.png` image included in the unit test
data and load it in the document layout (under General Settings).

The system does not detect that the image does not have color
information and attempts to read the R,G,B values (but the image only
has 2 values per pixel: the grayscale value and the alpha)

Versions affected: 13, 14

Behavior after the fix:

The image is loaded correctly (arguably, there is not a lot of interest
in detecting the primary color of a grayscale image, but the script
still returns a (gray) value which is preferrable to a traceback)

opw-2352394

closes odoo/odoo#59381

X-original-commit: 9efe5608aa4fb4f66475d3cb3e15ea332a3ded38
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Behavior before the fix:

Uploading a grayscale image with transparency in the company logo field
of the document layout causes a crash:

```
  File "/data/build/odoo/addons/web/models/base_document_layout.py", line 89, in _compute_logo_colors
    wizard.logo_primary_color, wizard.logo_secondary_color = wizard_for_image._parse_logo_colors()
  File "/data/build/odoo/addons/web/models/base_document_layout.py", line 191, in _parse_logo_colors
    color[1][2] &gt; white_threshold) and color[1][3] &gt; 0:
Exception

...
IndexError: tuple index out of range
```

To reproduce, use the `logo_ci.png` image included in the unit test
data and load it in the document layout (under General Settings).

The system does not detect that the image does not have color
information and attempts to read the R,G,B values (but the image only
has 2 values per pixel: the grayscale value and the alpha)

Versions affected: 13, 14

Behavior after the fix:

The image is loaded correctly (arguably, there is not a lot of interest
in detecting the primary color of a grayscale image, but the script
still returns a (gray) value which is preferrable to a traceback)

opw-2352394

closes odoo/odoo#59381

X-original-commit: 9efe5608aa4fb4f66475d3cb3e15ea332a3ded38
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] base: implement comment</title>
<updated>2020-09-04T09:45:10+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-09-01T12:27:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=efc0263b2574fa355ea794514eb3285d8c449260'/>
<id>efc0263b2574fa355ea794514eb3285d8c449260</id>
<content type='text'>
Forgotten TODO
Instead of checking in _for_xml_id (where 99% of calls are static),
verify on the few calls that accept an arbitrary argument

closes odoo/odoo#56876

Related: odoo/enterprise#12844
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Forgotten TODO
Instead of checking in _for_xml_id (where 99% of calls are static),
verify on the few calls that accept an arbitrary argument

closes odoo/odoo#56876

Related: odoo/enterprise#12844
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<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>[IMP] base: Document layout preview improvements</title>
<updated>2020-09-01T08:58:40+00:00</updated>
<author>
<name>Simon Genin (ges)</name>
<email>ges@odoo.com</email>
</author>
<published>2020-07-30T20:21:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c121a246f16899735306266a3a12b526e08e7620'/>
<id>c121a246f16899735306266a3a12b526e08e7620</id>
<content type='text'>
The document layout preview is a complete defferent simplified template
with its own css that replicates at best the different styles.
It does not have the external layout features and lack of fidelity.

The new preview actually use the real documents templates and put the
result in an iframe. It now has a high fidelity, though not perfect.

The goal is for a better onboarding, where clients see easely how
documents will look if they had an app to generate them. Of course, the
data on the document is a false invoice.

Refactor all this from base to web.

Task ID 2304177

closes odoo/odoo#56415

Signed-off-by: Lucas Perais (lpe) &lt;lpe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The document layout preview is a complete defferent simplified template
with its own css that replicates at best the different styles.
It does not have the external layout features and lack of fidelity.

The new preview actually use the real documents templates and put the
result in an iframe. It now has a high fidelity, though not perfect.

The goal is for a better onboarding, where clients see easely how
documents will look if they had an app to generate them. Of course, the
data on the document is a false invoice.

Refactor all this from base to web.

Task ID 2304177

closes odoo/odoo#56415

Signed-off-by: Lucas Perais (lpe) &lt;lpe@odoo.com&gt;
</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>[FIX] *: correct all or improve code translation lookup</title>
<updated>2020-06-30T10:19:59+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-06-26T07:21:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=400cc4f14ed12bce8d11ea515041253a9271f5a5'/>
<id>400cc4f14ed12bce8d11ea515041253a9271f5a5</id>
<content type='text'>
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: company report style on change layout</title>
<updated>2020-06-26T09:15:44+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2020-06-26T07:33:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=03a0b2d22c6676a1ad77e3fd9272e3c6bcff62c9'/>
<id>03a0b2d22c6676a1ad77e3fd9272e3c6bcff62c9</id>
<content type='text'>
When company layout is changed, we do not update the company styles for
report: thus we still have the old style for other layout that will not
change anything (besides font).

opw-2269849
closes #53706

closes odoo/odoo#53720

X-original-commit: 8897701b1754b40d8a83c5681907c38fb205657f
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When company layout is changed, we do not update the company styles for
report: thus we still have the old style for other layout that will not
change anything (besides font).

opw-2269849
closes #53706

closes odoo/odoo#53720

X-original-commit: 8897701b1754b40d8a83c5681907c38fb205657f
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: always use filter_domain for search panel counters</title>
<updated>2020-06-12T13:34:04+00:00</updated>
<author>
<name>Mathieu Duckerts-Antoine</name>
<email>dam@odoo.com</email>
</author>
<published>2020-06-05T09:19:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7002bdb2398ff89339493c99d00f4016d65f70c4'/>
<id>7002bdb2398ff89339493c99d00f4016d65f70c4</id>
<content type='text'>
The counters for categories were not updated when filter values were
selected. This commit fixes that situation.
This might impact the global performances of the search panel but
there is still room for improvement. Actually, it could be
possible to reload categories and filters less often by carefully
track the internal changes and the categories/filters attributes
(enable counters, expand,...).

closes odoo/odoo#49307

Related: odoo/enterprise#9795
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The counters for categories were not updated when filter values were
selected. This commit fixes that situation.
This might impact the global performances of the search panel but
there is still room for improvement. Actually, it could be
possible to reload categories and filters less often by carefully
track the internal changes and the categories/filters attributes
(enable counters, expand,...).

closes odoo/odoo#49307

Related: odoo/enterprise#9795
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
