Commit Graph
254 Commits
Author SHA1 Message Date
abd-msyukyu-odoo f75462eeaf [IMP] web_editor: expand deleterange for uneditables
In Chrome, it is possible to partially select the contents of a
contenteditable=false element if it has a contenteditable=true child.

This commit prevents breaking such uneditables by expanding the range in a
deleterange to fully contain such elements.

It will be useful with the new blocks introduced with the Knowledge module.

Task-id: 2794990
Part-of: odoo/odoo#86489
2022-05-05 11:41:57 +02:00
abd-msyukyu-odoo f4d72dd1ed [IMP] web_editor: prevent command refocus when unnecessary
Currently, the focus is forced on this.editable when using a powerbox command.

Knowledge /template will introduce blocks which are contentEditable=False, but
contains sub-elements with contentEditable=True, which are allowed to use
powerbox commands. Those sub-elements have another editable context as
this.editable. As such, forcing a refocus on this.editable will remove the
caret from the sub-element.

Avoid doing the refocus if the currently focused element is a child of
this.editable and is contentEditable=true.

Task-id: 2794990
Part-of: odoo/odoo#86489
2022-05-05 11:41:56 +02:00
abd-msyukyu-odoo c007dafae8 [IMP] web_editor: add failsafe upon CTRL+BACKSPACE
Prevents the user to remove the last child (if it is an empty block) of an
editable, in order to avoid the case where the user can add text nodes directly
in a block where it should not be possible (i.e. directly under this.editable).

Replaces any empty block other than `<P>` by an empty `<P>` which is the default
block for the editor.

Task-id: 2794990
Part-of: odoo/odoo#86489
2022-05-05 11:41:55 +02:00
abd-msyukyu-odoo e82e96f173 [IMP] web_editor: set contenteditable as a safe attribute
Add the attribute 'contenteditable' to the frozen list for html elements of
DOMPurify, so that this attribute is not sanitized in collaborative mode when
using _safeSetAttribute.

Task-id: 2794990
Part-of: odoo/odoo#86489
2022-05-05 11:41:54 +02:00
David Monjoie f3372799ae [FIX] web_editor: fix traceback on paste
When fakeEl is empty, firstChild and lastChild both equal null.

task-2842638

closes odoo/odoo#90523

X-original-commit: 626caa89cf290f226b19dfa73bc4ab41c7f95fc0
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-04 17:46:41 +02:00
Sébastien Geelen (sge) d8fd724cb3 [FIX] web_editor: transform orphan LI into P
Avoid living `<li>` tags without a `<ul>` or `<ol>` parent
in the editable html.

task-2842638

closes odoo/odoo#90518

X-original-commit: c6660d9ae1c931da3ad442b30f610db463ede894
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-04 17:46:35 +02:00
Antoine Guenet 53aba047ce [FIX] web_editor: apply original element attributes on toggle list
When converting an element to a list element, we didn't preserve that
original element's attributes. As a consequence the text direction was
lost.

closes odoo/odoo#90247

X-original-commit: 0731ff677491d80540fa2ffc645fd2b471a9f61c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-02 07:43:55 +02:00
Antoine Guenet 618d5bc3ca [FIX] web_editor: provide proper support for mixed language directions
This introduces a "direction" option on the editor to set the text
direction of the editor (passed by Odoo based on the localization), and
a Powerbox command to switch said direction on a given block. This
allows users to mix several text directions within the same text, eg.
when quoting Hebrew in an English text.

task-2814004

X-original-commit: 693df325588ccaf6385c9f610709f687ccdf61a8
Part-of: odoo/odoo#90247
2022-05-02 07:43:55 +02:00
Nicolas Bayet fa796c76ad [FIX] web_editor: past mulitple lines and undo
Before this commit, when pasting multiples lines a new step per line.
So when performing an undo, only one line was removed instead of the
whole pasted text.

task-2833740

closes odoo/odoo#89932

X-original-commit: 06fb4e3e8377dedb02644779f0077e0d883df918
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-28 09:00:50 +02:00
Nicolas Bayet 444fb09d1e [FIX] web_editor: prevent crash when inserting empty string
Before this commit, when unsing the function `insert()` with data being
an empty string, the function crashed but shouldn't.

task-2833740

X-original-commit: d44302550ddc027d4891ad04bf16c364e171e5ad
Part-of: odoo/odoo#89932
2022-04-28 09:00:50 +02:00
Nicolas Bayet c40d9e513c [FIX] web_editor: make checklist work in firefox
task-2833778

closes odoo/odoo#89918

X-original-commit: e3304148035ec04f435475bbf9ba803dc630ae37
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-28 09:00:45 +02:00
David Monjoie 5951960bcf [REV] web_editor: revert fix onChange event
task-2832078

closes odoo/odoo#89834

X-original-commit: 50dc710363a5222098e1fea2919b6fc4ae0aee65
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-27 14:29:10 +02:00
Sébastien Geelen (sge) 77178fe5ae [FIX] web_editor: fix onChange event
Ensure the `onChange()` callback is called
after each history steps in the editor.

Call the `_doAction()` directly, to avoid using the
disabled `_doDebouncedAction()`.

task-2760436

closes odoo/odoo#89339

X-original-commit: 18eaabcb4dab4682e3a94e16dbe66ff3c6f35a77
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-04-22 08:03:38 +02:00
Nicolas Bayet 54f499cc86 [FIX] web_editor: make HR element not editable
task-2778511

closes odoo/odoo#89267

X-original-commit: af23ab272fcf9c33980679b0215be2fff0ea1a86
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-21 15:06:48 +02:00
Sébastien Geelen (sge) 9b022bf2ff [FIX] web_editor : fix url transform & embed in paste
* Avoid auto-transforming an valid url inside an existing <a> tag.
* Ensure the current selection range is deleted
  before embedding an image or video.

task-2604627

closes odoo/odoo#89210

X-original-commit: 070bceeadd16e0b5643b91ad583449d31c48313d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) a538919bad [FIX] web_editor : fix html paste
We change the way we handle paste of html data :

The basic flow is :
1. if any range => deleteRange and continue from here
2. if the paste data has only one root <p> :
    > we unwrap its content in place
2. if the paste data has two root <p> :
    > we unwrap the content of the two p in place
    > we force a oEnter between the two contents
3. if the paste data has more than two root <p> :
    > we unwrap the content of the first and last p
    > we force a oEnter between the two contents
    > we insert the rest in between, out of focus block element

@see unit tests in `test/spec/copyPaste.test.js`

task-2604627

X-original-commit: 4dde6d37f30c35714c52e7e28f7011414fed7b6a
Part-of: odoo/odoo#89210
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) b17cdad276 [FIX] web_editor : fix whitelist of html pasted elements
whitelist of html element was not designed to keep the style
set by our own editor ( style on <span>).

We add a system to keep the spans when they meet some requirements.
Requirements are basically having one of the few allowed inline styling css rule.

@see tests in `test/spec/copyPaste.test.js` section 'Html Paste cleaning'

task-2604627

X-original-commit: da92c2335a1241ec9f3974d3bac1c4b7227b2d28
Part-of: odoo/odoo#89210
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) fcc035bcaa [FIX] web_editor : ensure break line consistency on delete
When delete backward/forward OR deleteRange,
we need to ensure the break lines stay consistent with the user action.

Some cases where not handled correctly.

Mainly when a <p> tags was removed and not directly adjacent to another block element.
In those case we kept too much or too little break lines.

@see tests added in `test/spec/editor.test.js`

task-2604627

X-original-commit: 9f14422ffceadd48b76ff460e4080e0cf5bc6fa2
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) 4bd57e41a4 [FIX] web_editor : fix element merge on deleteBackward
Ensure we never move nodes that were not initially in the deleted element.

When deleting an element and merging its content with its sibling,
the nodes contained in the removed element will temporary be hosted
in the common parent, beside possible other nodes.
We don't ever want to touch those others nodes when merging.

This change fix some instances where nodes would wrongly be carry
into another element.

@see new "merge node" tests in `test/spec/editor.test.js`

task-2604627

X-original-commit: 0af6e15ba9d15f20ec74144fd3069e6f409ef802
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) 7aaa481ee6 [FIX] web_editor : initialize powerbox property
Ensure the `_active` property on the PowerBox object is always a boolean.

@see test/spec/copyPaste.test.js

task-2604627

X-original-commit: 124298546cfbc129eb9ae934923a5e4e47392797
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) d41bf197d1 [FIX] web_editor : fix some linting errors
task-2604627

X-original-commit: df980347f8c8953c2c938343b1558d1a395c716c
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) f75b0635e2 [FIX] web_editor : add and change unit tests
ADD load of units tests covering :
  * text paste
  * html paste
  * image url embed on paste
  * url embed on paste
  * video url embed on paste

  * better coverage on some delete backward and forward

CHANGE some others unit tests :
  * tests about merging of block elements that where not accurate
  * test about insert HTML ( spec change )

task-2604627

X-original-commit: 378e8d1bd64e3758eb0202be33cb2d8c5bf97eea
Part-of: odoo/odoo#89210
2022-04-21 07:59:42 +02:00
Nicolas Bayet 595daa884a [FIX] web_editor: make o_editable unremovable
`o_editable` is not supposed to be removed.

Example of a problem if o_editable can be removed:
In translation mode, when deleting the text of the `o_editable` container,
that container could be removed but shouldn't.
See https://drive.google.com/file/d/1U_NUFBvUninOuFKn2H2c4BDcka3OetlD/view

task-2810332

closes odoo/odoo#89071

X-original-commit: 2010c0e2c402f5bb423a0fe683e51923e1e14042
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-20 09:33:01 +02:00
Nicolas Bayet 8b521b25f1 [FIX] web_editor: keep contenteditable=true on links
The function `setContenteditableLink` makes all the `contenteditable=true`
that are not the link or in the link being `contenteditable=false`.

Before this commit:
If we click on a link A then we click on link B, and if link B has
elements being `contenteditable=true`, the first click makes them
`contenteditable=false` and the second do not makes them
`contenteditable=true`.

After this commit
If we click on a link A then we click on link B, and if link B has
elements being `contenteditable=true`, the first click makes them
`contenteditable=false` and the second click now makes them
`contenteditable=true`.

task-2810332

X-original-commit: 72dd8d6e3c95f614353b1e87322a67c877c255c7
Part-of: odoo/odoo#89071
2022-04-20 09:33:00 +02:00
Tom De Caluwé e73fa8f671 [IMP] web_editor: test adding nested editables
Commit e834173314f00e36cb3a1f99690d9f220584682c fixed an issue where editable
elements could not be removed if they were nested in a non-editable element,
because the editor considered them to be an editable root.

However, the same logic also applied when doing a history step after adding
such an element. Adding a nested editable element would make the history step
invalid and result in a rollback.

Such a situation can be encountered when adding a recaptcha legal notice to a
website form. The footer of the form is a non-editable paet of the document,
however the legal notice can still be updated by the user. This commit adds a
separate test for the addition of such editable elements that were previously
considered unremovable.

opw-2723017

closes odoo/odoo#88733

X-original-commit: f693e8ed27f753a728d903dfe4d7d10ae1334526
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-14 10:50:07 +02:00
abd-msyukyu-odoo 42a42ebcfb [IMP] web_editor: flag only editable as unremovable
Prior to this change, if a contenteditable=true element was a child of a
contenteditable=false element, it was always flagged as unremovable=true.

In fact what should happen is that this.editable should be unremovable, but one
of its subchildren can be contenteditable=true while having a parent
contenteditable=false and not be unremovable.

Task-id: 2794990
X-original-commit: 72e2fd7439a0d6e44b5082def35079019371a3b7
Part-of: odoo/odoo#88733
2022-04-14 10:50:07 +02:00
Tom De Caluwé b0108010d0 [FIX] web_editor: make buttons properly translatable
A mechanism is provided by the OdooEditor to circumvent certain problems while
editing links. More specifically, editable zones are patched when editing a
link. This avoids the cursor ending up outside the link whenever the link tag
is emptied.

However, the mechanism does not check if the link is also in the editable zone
before doing so. In translation mode, the editable zones correspond to the
individual translation strings. When translating link texts, this means the
anchor tag containing the translation string is outside the editable zone. The
patching mechanism still applies, resulting in the anchor tag becoming editable
as well.

This causes problems while translating links, for example oDeleteBackward
commands are being rolled back. Checking if the anchor tag is inside the
editable zone resolves the problem.

opw-2780312

closes odoo/odoo#88674

X-original-commit: 99050b26446bbbe949e1fa797210c2a8a68d94cd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-13 16:54:04 +02:00
Nicolas Bayet 10d05a4288 [FIX] web_editor: disable editor video on the chatter and activity
The chatter and activity html have the video being sanitized upon
save. As it is a desired behavior, disable the ability to add
video from the editor for those field.

Task-2726483

closes odoo/odoo#88266

X-original-commit: c70d42d12eb522767f84a728c71ac30f66521e2a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-08 08:49:16 +02:00
Antoine Guenet bf25bf4161 [FIX] web_editor: properly navigate Powebox commands with arrow keys
The commands are grouped by command group when rendered by the Powerbox.
That creates a dissociation between the order in which they are rendered
and the order of the arrays in which they are present in the code. The
mechanism to navigate between them with the arrow keys is however
dependent on the latter. As a result we may end up with a visually
disordered navigation.
This adds a private function to reorder these arrays in the same way as
they are rendered, thereby fixing the dissociation.

task-2802749

closes odoo/odoo#87209

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-07 17:57:23 +02:00
Antoine Guenet ca79036764 [IMP] web_editor: hide the Powerbox when no commands are found
When no command is found in the Powerbox, the text "No results" is
shown, which is annoying. Instead, this hides the Powerbox we such is
the case.

task-2802749

Part-of: odoo/odoo#87209
2022-04-07 17:57:23 +02:00
Antoine Guenet c927e4be4a [IMP] web_editor: improve the design of the Powerbox
This is a general design upgrade for the Powerbox.

task-2802749

Part-of: odoo/odoo#87209
2022-04-07 17:57:22 +02:00
Nicolas Bayet 2cef72a970 [FIX] web_editor: properly select the command of powerbox
Before this commit
On mobile, clicking on a powerbox item called the first command.

After this commit
On mobile, clicking on a powerbox item call the clicked item command.

task-2751059

closes odoo/odoo#88059

X-original-commit: 03638e4d46941bb4751ac2d6df8c08cb4cc2208e
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-06 11:15:09 +02:00
Nicolas Bayet 378e9de97c [FIX] web_editor: open the powerbox in mobile
task-2751059

X-original-commit: 86b22141b9653bfad8d135af7f66ff9bc36084ba
Part-of: odoo/odoo#88059
2022-04-06 11:15:08 +02:00
Nicolas Bayet 1211a63489 [FIX] web_editor: select and fix button after linktool
When the user create a button in the website builder through the
powerbox command "/button":
- call the editor fix for the link
- select the link

task-2704540

closes odoo/odoo#88010

X-original-commit: 92fcd5e15cf3fec96cdd2565157cd41ffd39a084
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-05 17:17:30 +02:00
Nicolas Bayet 0f37addf61 [FIX] web_editor: prevent powerbox step from staying in history
Before this commit
Calling a command of the powerbox created a step that delete the input
content of the powerbox. That input content came back upon undo.

After this commit
The input content that select a command from the powerbox should
never come back upon undo.

task-2806849

closes odoo/odoo#87994

X-original-commit: 2da3d928ad4c7e7c285b753fb1241326089d45e7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-05 16:15:17 +02:00
Antoine Guenet ad7c0d8ea4 [FIX] web_editor: prevent traceback on remove highlight color
This prevents a traceback when no closest block to the root node can be
found in the sanitizer.

task-2796371

closes odoo/odoo#87187

X-original-commit: 2104f33985472cd59f067d2f1403518a332fac6d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-24 18:10:51 +01:00
Antoine Guenet 6b9ca81e76 [FIX] web_editor: replace oe-zws-empty-inline with new data attribute
This adapts new code which uses `oe-zws-empty-inline` to use the new
name `data-oe-zws-empty-inline` instead.

closes odoo/odoo#86930

X-original-commit: c8d892496e78beea804c80091f4b06dc2e858b59
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-22 22:12:56 +01:00
Antoine Guenet 6cd42319fa [FIX] web_editor: properly clean zero-width spaces inserted for formats
When inserting a format with a collapsed selection, we need to insert a
zero-width space. It should not be saved so we need to isolate it and
put the "oe-zws-empty-inline" attribute on its parent so it gets cleaned
up by the sanitizer.

X-original-commit: 4ce274ba39cd8046b9ef4e0b99df66913375f993
Part-of: odoo/odoo#86930
2022-03-22 22:12:55 +01:00
Antoine Guenet f41c3e4a42 [FIX] web_editor: unformat only if full selection is bold
Take `<p>a<b>bcde</b>f` and select the whole paragraph. If you click the
"bold" button, you would expect the whole paragraph to become bold. Only
if you only select "bcde" do you expect to unbold it. This is the
behavior of other editors. Odoo-editor so far was unbolding as long as a
part of the selection was bold.
The same applies to other formats.

Currently the format buttons are active when the closest start container
is that format but it should be active when pressing it would undo the
format, ie when the whole selection is that format. This harmonizes it
with the browser defaults.

task-2754127

X-original-commit: 69c5db26f81ace1a9a032b2ef7f488c997be00ad
Part-of: odoo/odoo#86930
2022-03-22 22:12:55 +01:00
Antoine Guenet 18ca8b44cd [FIX] web_editor: properly detect background color in toolbar
When a background color is applied on an ancestor, while it's visibly
there, `getComputedStyle` doesn't know. Because it did depend on it,
the toolbar showed the wrong color in these cases.
Eg: `<span style="background-color: red;"><b>a[]bc</b></span>` was
showing no background color.

task-2778416

X-original-commit: a125933b34500d51183bc5eb02a531fb3b293de5
Part-of: odoo/odoo#86930
2022-03-22 22:12:55 +01:00
Antoine Guenet 0f1071d309 [FIX] web_editor: properly toggle active link button
The link button was toggling its active state on every update of the
toolbar because we weren't passing the toggle function a boolean. and
if the element we were passing it was `undefined`, it triggered the
default behavior which is to just toggle. Instead we want it to be false
if the element is `undefined`.

X-original-commit: 7aecd36a169033a89defeb00ba0ae53cd64cdcd5
Part-of: odoo/odoo#86930
2022-03-22 22:12:55 +01:00
Antoine Guenet ab37804400 [FIX] web_editor: properly apply/unapply underline and strikeThrough
Underline and strikeThrough styles are special beasts in that they both
are applied to the `text-decoration-line` property. Unlike `font-weight`
or `color`, They behave like a border: setting
`text-decoration-line: none` to an element won't undo the value of the
parent and therefore the text will still show the decoration applied to
its parent. Similarly, nested decorations will apply over each other:
a text node whose parent has an underline decoration and whose
grandparent has a line-through decoration will be both underlined _and_
struck through.
Consequently, we can't treat these styles the same way we treat bold,
italic and colors:
1. To undo the style, we have to split the text from its styled ancestor
2. To apply eg underline to a struck through text, we have to insert a
   new span.

task-2778416

X-original-commit: 93102a7dcb3e2c1a5803ab99f2f924b0b24e44c2
Part-of: odoo/odoo#86930
2022-03-22 22:12:54 +01:00
Antoine Guenet fa417893a4 [FIX] web_editor: handle arrow keys next to zero-width spaces
Consider the following situation: `<p>a[]b<span><zws></span>c</p>`,
where `<zws>` is a zero-width space and `[]` is the collapsed selection.
On pressing the `ArrowRight` key, we want to enter the `<span>` so we
don't press once to be after the "b" then once again to be before the
`<zws>`. The cases with a non-collapsed selection, and with the left
arrow are analogous. This is what this commit allows us to handle.

X-original-commit: 8e1d5ff3f3bdef8ca2f0eb069c62140260aad3f6
Part-of: odoo/odoo#86930
2022-03-22 22:12:54 +01:00
Antoine Guenet 6844ff5a3f [FIX] web_editor: apply format, font-size and color collapsed
When the selection is collapsed it was impossible to set a format (bold,
italic, underline, strikethrough), a font-size or a color. This makes it
possible by inserting and selecting a zero-width space first, then
placing the caret to its left when we're done.

task-2778416

X-original-commit: b4eb0fe69bce5ca18d8450cd7118740f1d31f780
Part-of: odoo/odoo#86930
2022-03-22 22:12:54 +01:00
Antoine Guenet 3164697a7e [FIX] web_editor: ensure all formats use spans
The bold format is overridden to use inline style on a <span> rather
than a <b>. The other formats (italic, underline, strikethrough)
continued to use the default browser behavior. This harmonizes them.

X-original-commit: ce59bbd1c13d7fd4cc6971b89cc95386d95fcd75
Part-of: odoo/odoo#86930
2022-03-22 22:12:53 +01:00
Antoine Guenet 7411fc970b [FIX] web_editor: use styling commands on shortcut too
When pressing the italic or underline buttons, we pass through a command
in the editor. Their corresponding keyboard shortcuts however were not
intercepted by the editor and were therefore triggering the default
browser behavior. As a result we had different behaviors when using the
buttons and the shortcuts.

X-original-commit: 2e3c3b3a15fa6ff4fa209fc7dbac10864f8898a2
Part-of: odoo/odoo#86930
2022-03-22 22:12:53 +01:00
Nicolas Bayet 1428fe9542 [FIX] web_editor: set border and width of the table upon paste
task-2793106

closes odoo/odoo#86859

X-original-commit: e07a40f98999560aaa494bf2561811894e7775f7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-22 12:00:45 +01:00
Nicolas Bayet c721d06995 [FIX] web_editor: load odooEditor base style
Before this commit
The style for `li.oe-nested` was loaded only when the editor loaded.
The problem is that the style needs to be visible even when the editor
has never been loaded.

After this commit
The style for `li.oe-nested` is always loaded in the backend and in
the frontend.

Task-2793528

closes odoo/odoo#86817

X-original-commit: 6c26e24c3d52410c0a3a06ee9a9d0aad6858a438
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-21 17:57:09 +01:00
Nicolas Bayet 691f574cb3 [FIX] web_editor: allow to paste images in the editor
task-2734733

closes odoo/odoo#86797

X-original-commit: 996b41b36ae5ea935760a5962887b2fcc02c86fa
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-21 17:00:56 +01:00
Nicolas Bayet f126f0c95b [FIX] web_editor: reset content when resuming collobartion idleness
Before this commit, when:
- client A close it's laptop temporarily, client B
- client B save another content
- client A re-open it's laptop
then, client A still have the outdated record version.

Now, if client A reconnect and the record has been modified, the
editor gets reset with the updated record.

Task-2745104

closes odoo/odoo#86149

X-original-commit: 1070d37a6c02c8a873336f4533d1e319a8762405
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-10 09:00:13 +00:00