<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web_editor/static/src/js/backend/field_html.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] web_editor: have video button even if sanitized</title>
<updated>2021-02-18T11:52:45+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-18T09:55:27+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4cd7af47432869023214a0410229398e9fcc44d8'/>
<id>4cd7af47432869023214a0410229398e9fcc44d8</id>
<content type='text'>
If a field is sanitized, a6e2b484e2 would hide the video button because
the video does not show in backend. It is better for the consistency but
if the field appear in frontend, the video would still show so we
prevent something that worked (but is very not user friendly when
editing in backend).

This changeset go back to the previous behavior (keeping the code
simplification), at one point there should be a fix so at least when
editing we see the video (currently we see an empty div in given
conditions).

opw-2463746

closes odoo/odoo#66449

X-original-commit: 73f578192e453f7f8d276604017625b5e712b875
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a field is sanitized, a6e2b484e2 would hide the video button because
the video does not show in backend. It is better for the consistency but
if the field appear in frontend, the video would still show so we
prevent something that worked (but is very not user friendly when
editing in backend).

This changeset go back to the previous behavior (keeping the code
simplification), at one point there should be a fix so at least when
editing we see the video (currently we see an empty div in given
conditions).

opw-2463746

closes odoo/odoo#66449

X-original-commit: 73f578192e453f7f8d276604017625b5e712b875
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: shift+enter in editor add direct newline</title>
<updated>2021-02-18T11:01:31+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-18T09:04:42+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8fdd4c503aa7396ed0b1789d74d2a794d61b2508'/>
<id>8fdd4c503aa7396ed0b1789d74d2a794d61b2508</id>
<content type='text'>
Enter keypress browser event were removed in 3c372d1da8b.

It was reintroduced in text fields with d2f024d2543 and in source mode
of html field with b10ca1f6094b.

When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.

With the "Enter" prevention, SHIFT+ENTER did not work.

opw-2463746

closes odoo/odoo#66442

X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enter keypress browser event were removed in 3c372d1da8b.

It was reintroduced in text fields with d2f024d2543 and in source mode
of html field with b10ca1f6094b.

When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.

With the "Enter" prevention, SHIFT+ENTER did not work.

opw-2463746

closes odoo/odoo#66442

X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: disable embedded video for html fields in backend</title>
<updated>2020-10-21T15:59:35+00:00</updated>
<author>
<name>IEL</name>
<email>iel@odoo.com</email>
</author>
<published>2020-10-21T08:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=746bf53b4aecfc601f0581a948d7cb7153812c82'/>
<id>746bf53b4aecfc601f0581a948d7cb7153812c82</id>
<content type='text'>
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the
same time there is no easy way to fix it

STEPS:

* create a record with html field, e.g. project.task
* add an embedded video (File/Image icon)
* save

BEFORE: video doesn't work

AFTER: there is no option to add embedded video anymore

WHY:

* iframe tags are removed before storing html in database, so after saving a
record, embedded video doesn't work anymore
* possible fixes look too tricky for stable branches:

  * new field attribute sanitize_iframe=False -- requires changes in core python framework which may have side effect

  * adding iframe on client side -- the problem is that the backend doesn't
  have mechanism to use animation in html fields like it's done in
  website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632

  * adding iframe on server side -- parsing html fields in _read... Doesn't look good either

* double selector is required to make it work both in frontend and backend:

      $editable.closest('.o_editable, .note-editor')

* we don't need hardcoded exception for mailing.mailing, mail.compose.message
because those fields marked as sanitized (default value)

  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/odoo/fields.py#L1589-L1590
  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/addons/mail/wizard/mail_compose_message.py#L115
  https://github.com/odoo/odoo/blob/61734cdaf1cf6857125b1ece63928ab080359c6c/addons/mass_mailing/models/mailing.py#L77

* I don't apply this for Odoo 12, because js is refactored in Odoo 13 (e.g.
field_html.js has another name in Odoo 12)

---

opw-2353103

closes odoo/odoo#60474

X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Ivan Yelizariev // IEL &lt;yelizariev@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the
same time there is no easy way to fix it

STEPS:

* create a record with html field, e.g. project.task
* add an embedded video (File/Image icon)
* save

BEFORE: video doesn't work

AFTER: there is no option to add embedded video anymore

WHY:

* iframe tags are removed before storing html in database, so after saving a
record, embedded video doesn't work anymore
* possible fixes look too tricky for stable branches:

  * new field attribute sanitize_iframe=False -- requires changes in core python framework which may have side effect

  * adding iframe on client side -- the problem is that the backend doesn't
  have mechanism to use animation in html fields like it's done in
  website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632

  * adding iframe on server side -- parsing html fields in _read... Doesn't look good either

* double selector is required to make it work both in frontend and backend:

      $editable.closest('.o_editable, .note-editor')

* we don't need hardcoded exception for mailing.mailing, mail.compose.message
because those fields marked as sanitized (default value)

  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/odoo/fields.py#L1589-L1590
  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/addons/mail/wizard/mail_compose_message.py#L115
  https://github.com/odoo/odoo/blob/61734cdaf1cf6857125b1ece63928ab080359c6c/addons/mass_mailing/models/mailing.py#L77

* I don't apply this for Odoo 12, because js is refactored in Odoo 13 (e.g.
field_html.js has another name in Odoo 12)

---

opw-2353103

closes odoo/odoo#60474

X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Ivan Yelizariev // IEL &lt;yelizariev@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mass_mailing, *: restore mass mailing options</title>
<updated>2020-10-19T14:57:28+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-10-16T09:54:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1a916fc2362c0b006460d94a219366ade1cce058'/>
<id>1a916fc2362c0b006460d94a219366ade1cce058</id>
<content type='text'>
*: web_editor

The snippet options which were specific to mass mailing were not loaded
anymore as they were loaded outside of the iframe where the edition
take places. Fortunately, the generic options were still working and
are the most important.

This bug was only revealed thanks to another bug fix which wanted to
be done in the unloaded file.

Note: this fix is a series of huge hack to make it possible and as safe
as possible in stable versions. This obviously has to be refactored in
master, if not already done.

Part of https://github.com/odoo/odoo/pull/60203

X-original-commit: 7225ce6b862c4f6b99a97732833b43189530699a</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: web_editor

The snippet options which were specific to mass mailing were not loaded
anymore as they were loaded outside of the iframe where the edition
take places. Fortunately, the generic options were still working and
are the most important.

This bug was only revealed thanks to another bug fix which wanted to
be done in the unloaded file.

Note: this fix is a series of huge hack to make it possible and as safe
as possible in stable versions. This obviously has to be refactored in
master, if not already done.

Part of https://github.com/odoo/odoo/pull/60203

X-original-commit: 7225ce6b862c4f6b99a97732833b43189530699a</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: carriage return in source mode</title>
<updated>2020-07-28T18:16:22+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2020-07-28T14:14:53+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fff793f7d741dd96d51b05a1025960c6bad39ea8'/>
<id>fff793f7d741dd96d51b05a1025960c6bad39ea8</id>
<content type='text'>
Enter keypress browser event were removed in 3c372d1da8b.

It was reintroduced in text fields with d2f024d2543 and this PR do the
same and reintroduce it for source mode of FieldHtml (`html` widget).

opw-2302605
closes #55066

closes odoo/odoo#55081

X-original-commit: b10ca1f6094b7c8e6e222aa0ea3d1f891e79379a
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enter keypress browser event were removed in 3c372d1da8b.

It was reintroduced in text fields with d2f024d2543 and this PR do the
same and reintroduce it for source mode of FieldHtml (`html` widget).

opw-2302605
closes #55066

closes odoo/odoo#55081

X-original-commit: b10ca1f6094b7c8e6e222aa0ea3d1f891e79379a
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor, *: move image optimization feature to left-panel</title>
<updated>2020-06-05T18:11:53+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2020-05-19T09:21:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=aa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c'/>
<id>aa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c</id>
<content type='text'>
*: website, mass_mailing

In continuity with the nline crop, in an effort to make the image
workflow as seamless as possible in the website editor, the image
optimization feature has been moved out of the modal which could be
opened through the media-dialog and into the left panel.

This commit adds a quality slider and a width selector, as well as a
preview of the image's weight to the left panel, and removes the
image_optimize dialog.

This commit also introduces the possibility to add a color filter on
images.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755

closes odoo/odoo#51517

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

In continuity with the nline crop, in an effort to make the image
workflow as seamless as possible in the website editor, the image
optimization feature has been moved out of the modal which could be
opened through the media-dialog and into the left panel.

This commit adds a quality slider and a width selector, as well as a
preview of the image's weight to the left panel, and removes the
image_optimize dialog.

This commit also introduces the possibility to add a color filter on
images.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755

closes odoo/odoo#51517

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: do not store base64 of cropped image to html field</title>
<updated>2020-02-27T13:53:25+00:00</updated>
<author>
<name>Kishan Gajjar</name>
<email>kishanegajjar@gmail.com</email>
</author>
<published>2020-02-27T07:07:51+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a4451579bc05ac7d9d0a790e4e19b907c5804597'/>
<id>a4451579bc05ac7d9d0a790e4e19b907c5804597</id>
<content type='text'>
On crop dialog save, the image src is set to the base64.
We are creating an attachment for the cropped image if the user save the changes
and after that, we set the newly created image as the src of that image.

Meanwhile, when the user save the 'html' field, it is not creating
any attachment for the cropped image and also it leaves base64 as it is.
Due to that field store large data into the database.

this commit makes sure that attachment is created for cropped images
and update src before storing field value to the database.

closes odoo/odoo#46455

X-original-commit: 2bcaa25e67260e3013d4400d1b3ce380ba5cbd1d
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On crop dialog save, the image src is set to the base64.
We are creating an attachment for the cropped image if the user save the changes
and after that, we set the newly created image as the src of that image.

Meanwhile, when the user save the 'html' field, it is not creating
any attachment for the cropped image and also it leaves base64 as it is.
Due to that field store large data into the database.

this commit makes sure that attachment is created for cropped images
and update src before storing field value to the database.

closes odoo/odoo#46455

X-original-commit: 2bcaa25e67260e3013d4400d1b3ce380ba5cbd1d
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: deny videos in mass mailing</title>
<updated>2020-02-11T14:44:01+00:00</updated>
<author>
<name>Andrea Grazioso (agr-odoo)</name>
<email>agr@odoo.com</email>
</author>
<published>2020-02-04T08:08:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3ee9a9fbdc7ec099af08e9116cea92e39aa5bb36'/>
<id>3ee9a9fbdc7ec099af08e9116cea92e39aa5bb36</id>
<content type='text'>
Create a new mass mailing, add a video via youtube embed link, save.
Send email.

Embedding a video can't work because it embeds an iframe, which is not
supported by most email clients for security reasons.
Extending the noVideo flag also to mass_mailing

opw-2179665

closes odoo/odoo#45104

X-original-commit: f9f8c9cc4075fdc5fd4556aa49c914054469198a
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Create a new mass mailing, add a video via youtube embed link, save.
Send email.

Embedding a video can't work because it embeds an iframe, which is not
supported by most email clients for security reasons.
Extending the noVideo flag also to mass_mailing

opw-2179665

closes odoo/odoo#45104

X-original-commit: f9f8c9cc4075fdc5fd4556aa49c914054469198a
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: fix required html fields</title>
<updated>2020-01-31T17:20:34+00:00</updated>
<author>
<name>Jason Van Malder</name>
<email>jvm@odoo.com</email>
</author>
<published>2020-01-30T08:16:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=cf2f53e4cf4e8f5e2e2d23c5aaf4554630be68c8'/>
<id>cf2f53e4cf4e8f5e2e2d23c5aaf4554630be68c8</id>
<content type='text'>
Issue

    - Studio
    - Add an required html field
    - Create new record
    - Leave it empty

    It is saved

Cause

    The isSet function of FieldHtml widget, have a "/" in the &lt;br&gt; tag
    and summernote empty = &lt;p&gt;&lt;br&gt;&lt;/p&gt;. If you add a space, the value
    becomes &lt;p&gt;&amp;nbsp;&amp;nbsp;   &lt;p&gt;.

Solution

    Remove the "/" and the spaces, check if value != &lt;p&gt;&lt;/p&gt; &amp;&amp;
    &lt;p&gt;&lt;br&gt;&lt;/p&gt;

OPW-2183687

closes odoo/odoo#44427

X-original-commit: c984b1b1210cea1e63f3bc66cec2120554c76c2a
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue

    - Studio
    - Add an required html field
    - Create new record
    - Leave it empty

    It is saved

Cause

    The isSet function of FieldHtml widget, have a "/" in the &lt;br&gt; tag
    and summernote empty = &lt;p&gt;&lt;br&gt;&lt;/p&gt;. If you add a space, the value
    becomes &lt;p&gt;&amp;nbsp;&amp;nbsp;   &lt;p&gt;.

Solution

    Remove the "/" and the spaces, check if value != &lt;p&gt;&lt;/p&gt; &amp;&amp;
    &lt;p&gt;&lt;br&gt;&lt;/p&gt;

OPW-2183687

closes odoo/odoo#44427

X-original-commit: c984b1b1210cea1e63f3bc66cec2120554c76c2a
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: fix mail template toolbar in debug mode</title>
<updated>2019-12-19T15:26:15+00:00</updated>
<author>
<name>Jason Van Malder</name>
<email>jvm@odoo.com</email>
</author>
<published>2019-12-18T07:35:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fb926fe883b0fa3a509799b173d4d9abbc7910ab'/>
<id>fb926fe883b0fa3a509799b173d4d9abbc7910ab</id>
<content type='text'>
Issue

    - Install Mail template
    - Enable debug mode (normal or assets)
    - Create or edit a mail template
    - Click in the text editor

    The toolbar is not showing up (it does when we're not in debug mode)

Cause

    We are doing `splice(-1, 0, ['view', ['codeview']])` on toolbar
    which is undefined, the method crashes and the toolbar doesn't
    render.

Solution

    Checking if the toolbar is defined before doing all that logic.

OPW-2151675

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

    - Install Mail template
    - Enable debug mode (normal or assets)
    - Create or edit a mail template
    - Click in the text editor

    The toolbar is not showing up (it does when we're not in debug mode)

Cause

    We are doing `splice(-1, 0, ['view', ['codeview']])` on toolbar
    which is undefined, the method crashes and the toolbar doesn't
    render.

Solution

    Checking if the toolbar is defined before doing all that logic.

OPW-2151675

X-original-commit: 0e5ca50d5a8401bb3495e83691eab5c86a97a616</pre>
</div>
</content>
</entry>
</feed>
