The original issue appeared in mass_mailing where triggering the mail
template preview throws a client error.
This commit prevents commitChanges() from being called before the
element is rendered.
Task-ID: 1950784
The recent refactoring odoo/odoo@f296992 wrongly moved the ace editor
style from `web_editor` to `website`, even though ace is in `«eb_editor`.
The editor is also used in Studio (which does not depend on website) so
the style was missing in this case.
Task 1951290
closesodoo/odoo#32384
Signed-off-by: Christophe Matthieu <Gorash@users.noreply.github.com>
The editor has a tooltip editor wizard "Change media description and
tooltip", but when selecting an image there is also a tooltip:
"Double-click to edit"
added by the editor.
The combination of the two break the functionality, eg:
- if a tooltip is set with editor, then selecting the tooltip: we see
the set tooltip and not "Double-click to edit"
- if a tooltip is set with editor, then selecting the image back, then
opening the tooltip editor => the set tooltip is lost
With this changeset, we just do not show "Double-click to edit" tooltip
if there is a tooltip set on the element.
opw-1946801
closes#32482
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In the `getMatchedCSSRule`, the transcoder try to find the real value of
a `text-align: inherit` css rule by ascending the html tree until it
finds a `text-align` with a meaningful value. By default is exits if it
reachs the `<html>` top node but doesn't exit if a call to `.parent()`
exits the dom (the behavior of jquery is to return a dummy element when
calling `.parent()` on an element that has no parent). This lead to an
infinite loop for badly formatted html content.
opw-1951095
closesodoo/odoo#32014
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Following the refactoring of the web_editor (JS & CSS) when adding a
long link in a task's description the line starts to overflow from the
field and create an horizontal scroll.
This commit restores the CSS word-wrap properties to the form field html
allowing to nicely break the line on a word basis, preventing a possible
overflow.
Also it doesn't make sense to apply it on an iframe.
Task ID: 1942179
closesodoo/odoo#31988
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
The factor parameter of the mixin in charge of generating the spacing
classes was not correctly used.
closesodoo/odoo#31996
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, when user edited record having 'field_html' widget and
tried to save the record immediately, a traceback was faced sometimes
because content was not loaded yet. This commit fixes the issue
by calling super method if the content is not loaded yet properly.
Task: #1932687Closes: #30833closesodoo/odoo#31581
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Media dialog was trying to reach the current media's parent node, which
was not possible as it was cloned on instantiation.
To fix this, the `showImageDialog` now passes the `onlyImages` option
upon instantiation, checking the parent's data. It also passes the
media's parent if said parent is a video. This way, neither of these two
things need to be done in media dialog.
closesodoo/odoo#31634
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.
closesodoo/odoo#31632
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
For iframes, we need to inject summernote because there are references
to "document" in it. When loading the iframe, if it is canceled, there
is a risk that the library is erased and that it breaks the field html.
We must also slightly modify the library to prevent it from making
changes to the library of the main "window".
The next test was identical to the removed one, with the exception that
it inserts a character at the end, which really is the behavior we want
to test. The removed test was broken because it expected the range on
the parent, which is anyway equivalent in this case. This is confirmed
by the fact that inserting a character at either ranges indeed inserts
the character where it is expected to do so.
Deleting all the contents of a block node replaced it with a blank
paragraph node. To restore v12 behavior, it should only do that when
pressing backspace in an already empty block, which is now what it does.
When in the media modal, if one selected no media but clicked the "ADD"
button it resulted in an error and a failed RPC instead of simply
closing the modal without doing anything. v12 behavior is now restored.
closesodoo/odoo#31308
The link modal only opened on double-click directly on an anchor,
meaning that double-clicking text in a span node within the button (as
is the case in the call-to-action snippet for instance) wouldn't open
the modal.
Now it opens as long as we have an ancestor that is an anchor, unless
the double-click occurs on a media (eg: a pictogram), in which case it
should open the media's modal.
closesodoo/odoo#31229