<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web_editor/static/src/js/editor/snippets.options.js, 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] website, web_editor: fix colorpicker preview</title>
<updated>2021-05-27T13:28:46+00:00</updated>
<author>
<name>xO-Tx</name>
<email>mou@odoo.com</email>
</author>
<published>2021-05-21T16:09:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fd31c9a10f97c92a48d0589a8bbeaf13a641e891'/>
<id>fd31c9a10f97c92a48d0589a8bbeaf13a641e891</id>
<content type='text'>
Issue:

&gt; Set bg color combination for a snippet... &gt; Save
&gt; Edit mode &gt; Select the snippet
&gt; Open color palette in bg option
&gt; Hover a color option
&gt; When a color button is left, the preview is cancelled
  but the color combination class is not applied anymore.

In '_computeWidgetState' (for 'selectStyle' method), the right
value ('o_cci') is not returned because we get empty "colorNames"
(the "colorPalette" is not rendered on start).

The goal of this commit is to fix this behaviour by rendering the
colorPalette in start for snippet options, this way, the new code
won't affect the speed fix added in [1] for 'OPTIONS' tab.

[1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641

task-2538326

closes odoo/odoo#71174

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue:

&gt; Set bg color combination for a snippet... &gt; Save
&gt; Edit mode &gt; Select the snippet
&gt; Open color palette in bg option
&gt; Hover a color option
&gt; When a color button is left, the preview is cancelled
  but the color combination class is not applied anymore.

In '_computeWidgetState' (for 'selectStyle' method), the right
value ('o_cci') is not returned because we get empty "colorNames"
(the "colorPalette" is not rendered on start).

The goal of this commit is to fix this behaviour by rendering the
colorPalette in start for snippet options, this way, the new code
won't affect the speed fix added in [1] for 'OPTIONS' tab.

[1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641

task-2538326

closes odoo/odoo#71174

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: adapt warning when quality options are unavailable</title>
<updated>2021-03-05T15:18:11+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2021-02-24T07:09:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=84417a174bc2bb76730cc89783d3426a3a3b07d9'/>
<id>84417a174bc2bb76730cc89783d3426a3a3b07d9</id>
<content type='text'>
Previously, when quality options were not available, the option would
simply not be displayed. User feedback suggests that this is confusing,
as for example, in the case of modifying the image in a t-field, quality
options would not be available when starting the editor, but would
become available when picking the image again in the media-dialog.

Some leftover code allowed to display a warning about why the quality
options were not available in the case where the image is not local to
the database. This warning has been adapted to display a more
informative message about why quality options are not available, as well
as suggest a solution:
- External image =&gt; download the image and upload it in odoo
- t-field =&gt; "You need to choose this image again in the media-dialog or
reupload it to have access to quality options"
- Images that are in an unsupported format (anything other than PNG or
JPEG) =&gt; short explanation that quality options are only available on
PNG and JPEG images.

task-2466819
part of odoo/odoo#66732</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, when quality options were not available, the option would
simply not be displayed. User feedback suggests that this is confusing,
as for example, in the case of modifying the image in a t-field, quality
options would not be available when starting the editor, but would
become available when picking the image again in the media-dialog.

Some leftover code allowed to display a warning about why the quality
options were not available in the case where the image is not local to
the database. This warning has been adapted to display a more
informative message about why quality options are not available, as well
as suggest a solution:
- External image =&gt; download the image and upload it in odoo
- t-field =&gt; "You need to choose this image again in the media-dialog or
reupload it to have access to quality options"
- Images that are in an unsupported format (anything other than PNG or
JPEG) =&gt; short explanation that quality options are only available on
PNG and JPEG images.

task-2466819
part of odoo/odoo#66732</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: bgOptimize+parallax=bg no kaput</title>
<updated>2021-02-23T10:41:21+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-23T10:34:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6e47db5efcd78157f054144315a4812bbb6fbbd9'/>
<id>6e47db5efcd78157f054144315a4812bbb6fbbd9</id>
<content type='text'>
Scenario:

- set new background image
- set parallax
- save

=&gt; on next edition, the editor doesn't work on background anymore

Why:

- backgroundOptimize copy attributes of the original image to the real
  target element on save
- parallax change the real target element to a new child

=&gt; so if the original element was an editor (with data-oe-model, ...)
   attributes, with the combination of the two options we will save
   these editing attribute on the child element which is wrong (the
   editing attributes are added dynamically and should not be saved).

With this changeset, we don't copy the editing attributes in
backgroundOptimize when we copy the original target image.

opw-2427560
opw-2429340

closes odoo/odoo#66665

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Scenario:

- set new background image
- set parallax
- save

=&gt; on next edition, the editor doesn't work on background anymore

Why:

- backgroundOptimize copy attributes of the original image to the real
  target element on save
- parallax change the real target element to a new child

=&gt; so if the original element was an editor (with data-oe-model, ...)
   attributes, with the combination of the two options we will save
   these editing attribute on the child element which is wrong (the
   editing attributes are added dynamically and should not be saved).

With this changeset, we don't copy the editing attributes in
backgroundOptimize when we copy the original target image.

opw-2427560
opw-2429340

closes odoo/odoo#66665

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: can set bg position on root editor</title>
<updated>2021-02-22T17:45:52+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-22T17:37:40+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=96c22e816981d72c185520750167c514c6bded5b'/>
<id>96c22e816981d72c185520750167c514c6bded5b</id>
<content type='text'>
Scenario:

- go to /slides and start editing the page
- change the position of background banner
- save

=&gt; traceback

Why:

The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).

opw-2427560

closes odoo/odoo#66639

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Scenario:

- go to /slides and start editing the page
- change the position of background banner
- save

=&gt; traceback

Why:

The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).

opw-2427560

closes odoo/odoo#66639

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: no error background position + ctrl Z</title>
<updated>2021-02-19T14:13:58+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-19T14:10:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2c0aa825ee54ed674ff9f43722031df8e2f35ca6'/>
<id>2c0aa825ee54ed674ff9f43722031df8e2f35ca6</id>
<content type='text'>
Scenario:

- start editing background position
- press TAB key
- press CTRL + Z

=&gt; traceback

Why:

Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.

reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417

opw-2423445

closes odoo/odoo#66540

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Scenario:

- start editing background position
- press TAB key
- press CTRL + Z

=&gt; traceback

Why:

Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.

reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417

opw-2423445

closes odoo/odoo#66540

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor: instantiate color palette only when necessary</title>
<updated>2021-02-15T15:57:00+00:00</updated>
<author>
<name>Benoit Socias</name>
<email>bso@odoo.com</email>
</author>
<published>2021-02-08T13:01:27+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9aeba7dec95b397ef894f5a181920dff269d6ad4'/>
<id>9aeba7dec95b397ef894f5a181920dff269d6ad4</id>
<content type='text'>
Color palette are only visible once they are opened. However, we
instantiate them a lot to build the "options" editor panel which caused
the editor to appear buggy for some users... even if they would never
open a colorpalette. This fixes that issue. The fix is not entirely
stable but was made as stable as possible... better implementation will
be done in master.

task-2439295
https://github.com/odoo/odoo/pull/65223

closes odoo/odoo#65223

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
Co-authored-by: qsm-odoo &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Color palette are only visible once they are opened. However, we
instantiate them a lot to build the "options" editor panel which caused
the editor to appear buggy for some users... even if they would never
open a colorpalette. This fixes that issue. The fix is not entirely
stable but was made as stable as possible... better implementation will
be done in master.

task-2439295
https://github.com/odoo/odoo/pull/65223

closes odoo/odoo#65223

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
Co-authored-by: qsm-odoo &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web, web_editor: avoid rendering color palettes more than once</title>
<updated>2021-02-15T15:49:15+00:00</updated>
<author>
<name>Benoit Socias</name>
<email>bso@odoo.com</email>
</author>
<published>2021-02-03T11:13:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7f19f63b18bc7d17a393b3535492c7f90595ca39'/>
<id>7f19f63b18bc7d17a393b3535492c7f90595ca39</id>
<content type='text'>
Before this commit the palette was rendered each time it was opened.

After this commit if the palette has already been rendered only the
selected color is being updated in the palette (and its colorpicker).

task-2439295
https://github.com/odoo/odoo/pull/65223

Co-authored-by: Samuel Degueldre &lt;sad@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit the palette was rendered each time it was opened.

After this commit if the palette has already been rendered only the
selected color is being updated in the palette (and its colorpicker).

task-2439295
https://github.com/odoo/odoo/pull/65223

Co-authored-by: Samuel Degueldre &lt;sad@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: insert record name as text</title>
<updated>2021-02-05T16:19:19+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2021-02-05T12:24:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1e3a11cb5f7a1f07a9e61240f027ff54c0dee847'/>
<id>1e3a11cb5f7a1f07a9e61240f027ff54c0dee847</id>
<content type='text'>
Previously, the many2one widget from the web_editor used jQuery's
'.html()' method when inserting a record name into the page. The record
name was not HTML-escaped before this, which may have unexpect result
and break the layout.

This commit fixes that by using the '.text()' method instead.

This bug only affects pages containing a many2one (contact excluded)
at the time of selection and not after the selection.
e.g. on the /event page, changing the category of an existing event
via the website editor

closes odoo/odoo#65642

X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the many2one widget from the web_editor used jQuery's
'.html()' method when inserting a record name into the page. The record
name was not HTML-escaped before this, which may have unexpect result
and break the layout.

This commit fixes that by using the '.text()' method instead.

This bug only affects pages containing a many2one (contact excluded)
at the time of selection and not after the selection.
e.g. on the /event page, changing the category of an existing event
via the website editor

closes odoo/odoo#65642

X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: fix background layers buttons</title>
<updated>2021-02-02T23:16:33+00:00</updated>
<author>
<name>xO-Tx</name>
<email>mou@odoo.com</email>
</author>
<published>2021-02-02T16:38:37+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=aba9056e7baa58decf147313678ad9d1f4522dee'/>
<id>aba9056e7baa58decf147313678ad9d1f4522dee</id>
<content type='text'>
Example to reproduce:

Drop the "Cover" snippet and try to remove the background
image. Clicking on image button has to be done 3 times to land on the
correct result:

- First click removes image, but not filter and leaves both buttons
  checked
- Second click removes the filter and unchecks its button.
- Third click unchecks the image button.

It should be one click to remove image, filter and uncheck both buttons.

The goal of this commit is to prevent _applyOptions() from setting
background-image values if image is not optimizable. This filter will
solve the issues since empty values (badly parsed by getBgImageURL())
won't be added as background urls.

task-2312878

closes odoo/odoo#62984

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Example to reproduce:

Drop the "Cover" snippet and try to remove the background
image. Clicking on image button has to be done 3 times to land on the
correct result:

- First click removes image, but not filter and leaves both buttons
  checked
- Second click removes the filter and unchecks its button.
- Third click unchecks the image button.

It should be one click to remove image, filter and uncheck both buttons.

The goal of this commit is to prevent _applyOptions() from setting
background-image values if image is not optimizable. This filter will
solve the issues since empty values (badly parsed by getBgImageURL())
won't be added as background urls.

task-2312878

closes odoo/odoo#62984

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: save custom snippets per website</title>
<updated>2021-01-22T14:53:30+00:00</updated>
<author>
<name>Benoit Socias</name>
<email>bso@odoo.com</email>
</author>
<published>2021-01-22T11:45:27+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=42e0f9112404541d1c11ba35e7a3d9bcb939f73b'/>
<id>42e0f9112404541d1c11ba35e7a3d9bcb939f73b</id>
<content type='text'>
Before this commit the custom snippets were saved across websites
because the RPC mechanism used by the save &amp; reload does not include the
context by default.

After this commit the custom snippets are saved for the specific website
as initially intended.
No migration is needed: already created snippets that have been created
across all sites will have the correct lifecycle because of the
copy-on-unlink system: trying to delete one will make it specific on
other websites.

Related to task-2374802

closes odoo/odoo#64917

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit the custom snippets were saved across websites
because the RPC mechanism used by the save &amp; reload does not include the
context by default.

After this commit the custom snippets are saved for the specific website
as initially intended.
No migration is needed: already created snippets that have been created
across all sites will have the correct lifecycle because of the
copy-on-unlink system: trying to delete one will make it specific on
other websites.

Related to task-2374802

closes odoo/odoo#64917

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
