Before this commit, the cropper tool was opened by a closure that spawned the Cropper
tool aside from the editable document.
This was anoying as the editable document can be in an iframe, hence the Cropper would have
been virtually unusable.
This commit factorizes the code in a method to allow overrides. Which is done in
web_studio:ReportEditorWysiwyg.
opw-3484065
closesodoo/odoo#150904
Related: odoo/enterprise#55049
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
To load images in an iframe, the web_editor code expected the iframe to have an src
attribute and built an URL for the image on the basis of that url.
With the srcdoc attribute, there is no need for an src, making the code crash.
After this commit, if an iframe only has srcdoc, we build images' url on the basis of
the main window.
opw-3484065
Part-of: odoo/odoo#150904
Before this commit, the image processing code always added a listener on the load event
of an image before opening the Cropper tool.
If the image was already loaded, the promise did not resolve at all.
After this commit, an image can be already loaded without any Promise not to be resolved.
Part-of: odoo/odoo#150904
Before this commit:
Sometimes applying bulletlist does not produce the expected bullet list
formatting .This issue arises when the selection is on an emptyTextNode(""), and
the traversal of nodes using getTraverseNodes results in the same
emptyTextNode(""). In the toggleList function, we typically remove the
emptyTextNode(""), leaving no appropriate node for creating a bullet list.
After this commit:
Now it will create bullet list because we move the selection to its parent when
it is on an emptyTextNode(""), similar to what we have done with the "BR" element.
task-3547574
closesodoo/odoo#150854
X-original-commit: d5380742b05c64ced7eee92fcf520f208e33819e
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
__Current behavior before commit:__
If `child` is not an `Element` (like a Text or a Comment node), the call
to `querySelectorAll` at the following line will crash.
__Description of the fix:__
End the current loop iteration if `child` is not an `Element` to avoid
calling `querySelectorAll` on it.
__Steps to reproduce the issue on runbot:__
In 15.0:
- Open Email Marketing > Mailings > Create > Second template
- Drag and drop a `Comparisons` block
- Display source code
- Write some text under the `<div class="card ...">`
- Save --> Traceback
In 16.0+:
- Open Email Marketing > Mailings > New > `Start From Scratch`
- Drag and drop an `Event` block
- Replace one of the image (a comment node will be added [here][1])
- Save --> Traceback
opw-3682469
opw-3689181
[1]: https://github.com/odoo/odoo/blob/df1b43a6de5ad15a8fee3713de7d8ec926c61f12/addons/web_editor/static/src/js/backend/convert_inline.js#L715closesodoo/odoo#150752
X-original-commit: 3d1c95d9d143df35320e97abf898f673f4bb1a68
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
Since [1] a margin is applied when another `o_we_user_value_widget`
follows a color palette. Unfortunately this is also applied when the two
elements are not on the same row. Because of this the "Slideout Effect"
option below the "Colors" option of "Footer" looks like it is indented
while it is unrelated to the color selection.
This commit restricts that margin to elements that belong to the a
`we-row`.
[1]: https://github.com/odoo/odoo/commit/2f81c6ae68751d5f93c30aef822730ee04ead391
task-3696870
closesodoo/odoo#150701
X-original-commit: 50c0a5479a11fef0b03bf319283817a94a32cea4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Reproduction:
1. in Note, type ` abcd ` in an empty note
2. color the background of all the text, bold `abcd`
3. select from the end till the letter `b`, try to change the color,
traceback pops up
Fix: The main reason is we remove element in `splitElement`/
`splitAroundUntil`. In this special case, there are two selected nodes
which returns the same font element. The first font element will be
removed and replaced first. Because the first font element doesn’t exist
anymore, when recovering selection, the second element considered as
collapsed and the recovered selection is a caret. Thus the color picker
is gone after applying the color (preview)
The fix is then, we always make sure that the font we have is still
connected to the page (exist in the page), otherwise it’s problematic to
apply color to a non-existing element and recover cursor from it. If
there is font element(s) that is not connected, we simply get the fonts
again, because new font element is created for the second node, it won’t
split (remove) the first node’s font element again
Task-3476494
closesodoo/odoo#150500
X-original-commit: 06a8b930176093e2c5a853b78431316af90f3550
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Co-authored-by: Goaman <nby@odoo.com>
Before this commit:
When a user edits an article and selects the restore button to revert to a
previous version, the displayed time is incorrect because it shows universal
time instead of the user's timezone.
After this commit:
When a user edits an article and utilizes the restore button to revert to a
previous version, the timestamp will now reflect the time in the user's current
timezone.
task-3641579
closesodoo/odoo#149177
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
*website
Steps to reproduce:
- Drop a "Text-Image" snippet on the website.
- Click on a column and hide it on desktop.
- Click on the parent snippet and hide it on desktop.
-> The column is not a child of the parent in the invisible entry.
Since [1], invisible snippets are shown hierarchically in order to
better visualize the "parent-children" relation that could exist between
them. To do so, [1] based its logic on the `.o_snippet_invisible` to
find the invisible elements. However, since [2], a distinction has been
made between elements that are hidden only on desktop, only on mobile or
on both depending on some conditions. The goal of this commit is to take
the new `o_snippet_mobile_invisible` and `o_snippet_desktop_invisible`
classes into account at the creation of the invisible entry.
[1]: https://github.com/odoo/odoo/commit/922d3e63b597b1ef7fbbb5ebb4641a3ad8bdf4ed
[2]: https://github.com/odoo/odoo/commit/3103e0553011b5c1f4078972d7a88fa3fd4068b2
task-3679823
closesodoo/odoo#150512
X-original-commit: c8f247ee5fa178f012b2852cba3d0e9322a2c3a6
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
Before this commit:
-Font styles shows active while selecting cells.
After this commit:
-Font styles should not be active by default.
task-3547652
closesodoo/odoo#150443
X-original-commit: d026f4d7160ec00b6cb27b4cf5b34afc9dbfda13
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Before this commit:
If we entered text within a inline-code block and pressed the backspace key,the
zero-width space (zws) at the end of the inline-code block would be deleted.
Consequently, there was no way to exit the inline-code block.
After this commit:
Users can now navigate out of the inline-code block by using the right or left
arrow keys when inside an inline-code block.
task-3613340
closesodoo/odoo#150453
X-original-commit: 31c73e9dd53fa0f7379d87e9c9970b2788e454cd
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
The method `getValue` of the wysiwyg could have some cleaning on the
value that will always make it different from the original value.
The _isDirty method of the html field will now make the original value
be processed by the wysiwyg `getValue` to be able to compare it
with the current value.
The sanizite call in `OdooEditor.cleanForSave` had the wrong root. As
we are calling `cleanForSave` for an element that is not inside the
editable, the root cannot be `this.editable`.
task-3679122
closesodoo/odoo#148996
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Steps to reproduce:
- Go to website (“Edit” mode) > Add a “Big Boxes” block.
- Switch to “Grid” mode > Select the last column n (while n > 1) and set
a background image on it.
- Try to change the background position > You cannot save or cancel the
changes since the option buttons (“Apply” & “Discard”) are invisible.
This is simply because the grid element was cloned on the background
container (`.o_overlay_background`) with its grid `z-index` style
(with `z-index` === n) which automatically hides the buttons.
The goal of this commit is to fix this behaviour by simply forcing the
`z-index` of the background element to 0.
task-3648466
closesodoo/odoo#150351
X-original-commit: 7dbb25dfeae25f27e10d4052db98c5f9d93699ff
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Current behaviour before commit:
In tablepicker, number of the selected cells (rows X cols)
is not visible at the bottom.
Desired behaviour after commit:
Now, number of the selected cells is visible at the bottom of
tablepicker.
task-3662728
closesodoo/odoo#150243
X-original-commit: 72aae3599c8cd81fc00b2d46a432ee20f7c44b13
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
When pasting text inside the editor, if the text looks like a URL, a
link is implicitly created.
Unfortunately, this also happens when the edited element does not
support HTML.
Because of this, when translating a page, links are created inside the
translated text which does not support HTML.
This commit solves this by pasting the plain text if the target of the
paste does not support HTML (which is the case for translations).
This commit also prevent link creation when typing a space after text
that looks like an URL in targets that do not support HTML.
In saas-16.4, `_handleAutomaticLinkInsertion` is also adapted to prevent
unwanted link creation.
Steps to reproduce for first scenario:
- Add French to your website.
- Edit your master English Home page.
- Drop a Text snippet in the Home page.
- Save the Home page.
- Switch to French.
- Translate the page.
- From an external text input, copy `http://odoo.com` in your clipboard.
- Put the cursor inside the Text snippet's text.
- Paste.
=> A link was created.
Steps to reproduce for second scenario:
- Add French to your website.
- Edit your master English Home page.
- Drop a Text snippet in the Home page.
- Save the Home page.
- Switch to French.
- Translate the page.
- Put the cursor inside the Text snippet's text.
- Type `http://odoo.com` followed by a space.
=> A link was created.
opw-3546308
closesodoo/odoo#150189
X-original-commit: de351e500559166963fd2e748229d5c1d901aa44
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Before this commit:
Attempting to delete a selected table row does not result in the removal of the
row in Firefox.
After this commit:
Now deleting a selected table row results in removal of the row in FIrefox.
task-3610789
closesodoo/odoo#150167
X-original-commit: 5dd99a02fc3cce99969e696b5cf428afaa27ba78
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Issue:
=====
Users with IOS can't sign with safari.
Steps to reproduce the issue:
=============================
- Install sign
- Make sure you have a template which has at least one signature sign
item.
- Share the document and open the link with ios on safari in v 15.4+
(browserstack) for example.
- Go to the signature sign item and use auto and click sign or sign all
- Nothing will happen.
Origin of the issue:
====================
https://github.com/niklasvh/html2canvas/issues/2864
Solution:
=========
https://github.com/niklasvh/html2canvas/issues/2864#issuecomment-1111044861
opw-3660682
closesodoo/odoo#149903
X-original-commit: f11723f406f2af95090bdd13e9acb30c89014638
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit addresses an issue where the text selection would disappear from
editor when clicking on the font size option from the toolbar.
Modifications:
- The issue of text selection disappearing when interacting with the font size
dropdown has been fixed.
- A new toolbar option, `customFontSize`, has been added. This option is
exclusively enabled for editor that have a toolbar in the same document.
The `readonly` attribute has been added to the input field to make it read-only
in our scenario, providing dropdown functionality for font size in the editor.
However, the functionality remains unchanged for the website.
task-3500827
closesodoo/odoo#142808
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Typing a valid http URL + SPACE transforms the URL into a link (anchor
element).
[1] broke such URL transformation if the URL is followed by punctuation
characters, e.g. "somelink.com...".
After this commit, typing "somelink.com..." + SPACE transforms
"somelink.com" into a link, restoring the behavior prior to [1].
task-3602890
[1]: https://github.com/odoo/odoo/commit/4da0608f7c7cd7a6550ec40535b9562fb35c5417closesodoo/odoo#147845
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Commit [1] added the support for images with a link set on them in grid
mode.
As a follow up, this commit does the following:
- Removes the `!important` from the grid image anchor CSS rules, as they
were not really needed.
- Checks if the image has a closest `o_grid_item_image` column instead
of checking the parent in the `GridImage` options. Indeed, this class
already guarantees that the image is well a grid image; we can therefore
simplify the code.
It also removes a comment that was forgotten in commit [2].
[1]: https://github.com/odoo/odoo/commit/085d70cea571ea80c141ac6005e8bd8333bd269f
[2]: https://github.com/odoo/odoo/commit/d8c374e3e6b31bf88aa42952aadf3379936f7600
related to opw-3580128
closesodoo/odoo#149681
X-original-commit: 9244e85ebb9e1605292698fe31ad94da7709ab86
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit adds a new event listener on the odooEditor which listens for
external history steps (if collab mode is enabled), and changes the state of
the record's dirtyness when a user receives external steps.
This way a user will see that the record has been modified when he is editing
a collaborative html field.
task-3609594
closesodoo/odoo#145928
Related: odoo/enterprise#51579
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
do not compare types, for exact checks use `is` / `is not`,
for instance checks use `isinstance()`Flake8(E721)
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Steps to reproduce:
- Add an image on the website.
- Save.
- With the HTML editor, change the src of the image (to
"https://odoo.com/logo.png" for example) and remove the
`mimetypeBeforeConversion` data attribute of the image. Note that it is
important to change the src of the image to ensure that the system does
not add the `mimetypeBeforeConversion` data attribute back on the image.
- Enter in edit mode and click on the image.
-> Traceback of type "Cannot read properties of undefined (reading
'split')".
This traceback appears because the `_renderCustomXML()` method of
`ImageHandlerOption` relies on the presence of formats on the list
returned by the `_computeAvailableFormats()` method. Since [1], if there
is no `mimetypeBeforeConversion` data attribute on the image, one of the
format in the list is `undefined`. As `_renderCustomXML()` tries to
perform a `split()` on this format, a traceback appears.
Although the steps to reproduce the result seem tricky, it has been
decided to create a fix for this situation. Indeed, in version prior to
16.4, the equivalent steps to reproduce (in which the `mimetype` data
attribute is removed instead of the `mimetypeBeforeConversion`) do not
lead to a traceback. In those versions, if there is no mimetype on the
image, the options such as "Filter", "Width" and "Quality" are not shown
in the editor panel. The goal of this commit is to apply the same logic
for the version 16.4; hide the "Format" option if the image does not
have the `mimetypeBeforeConversion` data attribute. To do so, the
`_computeWidgetVisibility()` method has been adapted consequently. To
avoid the traceback, the `_computeAvailableFormats()` method has been
adapted. It now returns an empty list if the image does not have the
`mimetypeBeforeConversion` data attribute. As there is no `undefined`
format in the returned list of valid formats, the traceback is avoided.
[1]: https://github.com/odoo/odoo/commit/730588b802506844e6ca54df312333bfd8df1d52
task-3631487
closesodoo/odoo#148882
X-original-commit: 485a5d74198668fa2f2240b4e31a871f36225857
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When the content of the editor is reset, the collaborative selection
should be reset as well. Otherwise, the selection is not reset and
the user can still see the selection of the previous content.
task-3675074
closesodoo/odoo#148826
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Before this commit, when restoring a document was made, it would reset
the content of the editor without any consideration for the mechanism
that detect stale documents and without any consideration for the
collaboration.
This commit fixes 2 problems in one shot:
1) Any change made in the editor after a restore was impossible to
save. The reason is that the restored version would reset the wysiwyg
without the id `data-last-history-steps` of the version in database in
the historyIds of the odooEditor wich subsequently would trigger the
stale document detection, preventing the save.
2) The reset would be propagated to other peers in collaboration. The
reason is the same as the 1st problem, the wysiwyg would be reseted,
not informing other peers of that reset.
task-3675074
Part-of: odoo/odoo#148826
*: website
This basically reverts the parts of [1] that are the known cause of race
conditions in runbot tests (in particular, the link tools one:
`test_15_website_link_tools`). But more importantly, this just did not
make sense to stop observing changes for async period of time, at least
unless there is no alternative given the state of the related code.
Commit [1] test-hack was actually adapted with [2] which probably made
it even more unreliable and hacky.
On top of that, this commit is of course trying to restore whatever
purpose this was made for ("dirty" flag addition, the history steps
recording, etc). Although fixing those the most robust way would
probably require a deeper refactoring in master and other stable fixes.
Note: in this forward-ported version, the test is still disabled on
runbot and broken for other reasons. Those will be fixed later.
[1]: https://github.com/odoo/odoo/commit/8cab404dce3a65c0bdd635a93682ee14282a3ebb
[2]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35
runbot-18747
closesodoo/odoo#148728
X-original-commit: 003422a73f0b5fb5540fbf2bd95a26a6dd663530
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
The editor has a feature that allows to automatically select a whole
paragraph on click when that paragraph contains text by default. At the
origin, this happened at every click on the element, until its content
was replaced, by typing something while it is selected or the cursor is
inside. Placing the cursor inside was actually impossible by clicking on
the element, since this forced a selection on the whole text again.
Since [1], that behavior changed (for no apparent reason): only the
first click forces a selection on the element. This is done by removing
the marker class from the element ("o_default_snippet_text"). Also, the
code which removed that class while typing was left behind... even
though it did not work anymore due to a code typo.
This commit fixes that without changing the main behavior:
- On click, we do not remove the marker class anymore, but only force a
selection on the text if it was not already seen before. Small change
of behavior: not changing the text and coming back later in edit mode
will force a selection on the text again on click.
- While typing, the code removes the marker class and thus the text will
never have a forced selection again (fixed the code typo).
Note: we may reconsider restoring the behavior there was before [1], in
master. Automatically selecting default text that was never changed
could indeed be better, although it will require better code to allow
placing the cursor inside easily anyway.
The main purpose of this fix is to avoid a mutation of the DOM on click
(removing the marker class). Indeed, this wrongfully marked the page as
dirty.
Steps to reproduce:
- Enter edit mode
- Add a "Text - Image" snippet
- Save
- Enter edit mode again
- Click on the first paragraph of the snippet (=> it is auto-selected)
- Click on discard
=> A popup appears to say you will lose your changes... while you did
not make any.
[1]: https://github.com/odoo/odoo/commit/912996fe902c41cafa12dcfe09713ce9857f95ab
Related to runbot-18747
X-original-commit: 3cc5bbcab641d7d436ebfbb0f160c9e0d77da142
Part-of: odoo/odoo#148728
*: web_editor
Commit [1] made the multiple drag and drop feature of the editor stop
using jQuery and used our own implementation. Unfortunately, the
initialization of that implementation in the case of the "drag column
on image move" feature marked the page as dirty by mistake.
Steps to reproduce:
- Enter edit mode
- Add a "Text - Image" snippet
- Save
- Enter edit mode again
- Click on the image of the snippet (and do not do anything else)
- Click on discard
=> A popup appears to say you will lose your changes... while you did
not make any.
[1]: https://github.com/odoo/odoo/commit/7594d71ca8610d5947e80f325ccb57abc23c2c76
Related to runbot-18747
Part-of: odoo/odoo#148728
*: web_editor
Next commits will extend the main new test to make sure the flows they
are fixing are not wrongfully marking the pages as dirty. This commit
introduces it on its own as it deserved some more detailed explanations.
In 15.0, where this commit is being merged, the final version of the
test was failing for no apparent reason on staging only. This is because
the staging builds are made with more apps... which fill the website
menu with more items in such a way the "+" auto-fold menu feature comes
in play. That feature is marking the page as dirty by mistake in this
version, 3 different ways for 3 different configurations:
- the menu is not folded outside of edit mode and when entering edit
mode, the "+" appears and some menu are folded
- the menu is folded outside of edit mode and when entering edit mode
the resize actually makes it so a different set of menu is folded
- the menu is folded outside of edit mode and when entering edit mode
it stays the same (known to have been broken because edit mode
tweaks the dropdown behavior)
The first problem with this is actually the way we check the page is
dirty in case of discard: we check the whole DOM and compare it to the
way it was when entering edit mode... the whole DOM, including the non
editable parts. This is wrong by definition but it is also weird that it
does not match what is done when we *save*: where we only consider
sections that are explicitly marked as dirty (.o_dirty) and other
exceptions. This can't be changed in stable though, some save / discard
override may rely on this (not marking with the o_dirty class etc).
In 15.0, the original commit of this forward-ported version fixed the
3rd case described above, which was less risky than fixing the 2 others.
The cause for the DOM diff in that case was the `data-toggle="dropdown"`
which mysteriously reappeared between the moment we check the "initial
DOM" and the "DOM when we try to discard". This was because of [1],
which makes the dropdowns behave differently in edit mode, combined with
the fact that the "+" menu is re-rendered after each resize (and one is
triggered when entering edit mode since [2], originally for that
actually). That behavior is however apparently not needed for the "+"
dropdown, so we simply disable it. Some lower level fix is still needed
but will be done in master, as the real problem falls in the dirty page
detection system. A test was added for this specific third case.
In 16.0, this is different: all 3 cases seem fixed, probably indirectly
thanks to the website-in-iframe refactoring at [3] and the bootstrap 5
migration at [4]. Not sure. This forward-port commit thus only adds
tests and a bunch of comments. Note that what was said about the 15.0
version was actually not entirely true: "That behavior is however
apparently not needed for the "+" dropdown, so we simply disable it." is
actually wrong. Indeed, it changed the behavior when clicking *outside*
of the extra items menu (which is less important). A patch in 15.0 will
be backported anyway to explain that.
To make the final test pass, it ensures most menus are removed so that
the "+" feature is basically disabled always during the test. Behaviors
will of course be fixed in further versions.
Note that in this 16.0 forward-ported version, a test kinda already
existed for this... although it was badly written and the code that was
merged with it actually worsened the dirty check behavior. See [5].
This commit adds comments around some more problematic parts.
[1]: https://github.com/odoo/odoo/commit/fe67b34f1a03d838df82a1307cf6467f994a8f3b
[2]: https://github.com/odoo/odoo/commit/392c91cda3133b921e9aca9a7b1c511231027438
[3]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[4]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
[5]: https://github.com/odoo/odoo/commit/650a97d1bd59254cc2115d54d58940b6112a8d70
Related to runbot-18747
X-original-commit: a0b741a53fef6a2a15d9283397dd7ec22d624382
Part-of: odoo/odoo#148728
Before this commit, when trying to remove a format of a
`data-oe-zws-empty-inline` of an empty block, the attribute was added to
that block and would never be removed. Also, unformatting a zws would
not remove the zws from the dom.
How to reproduce the original bug:
- put the selection inside an emtpy p
- ctrl+b (in windows/linux) or cmd+b (in mac)
=> The zws attribute data-oe-zws-empty-inline is added on the P rather
than creating a span.
- The next letter that will be typed will not be bold but should be
bold
- That attribute should not exists in a block, that could lead to
unexpected bug
task-3628480
closesodoo/odoo#148659
X-original-commit: 7b7e343e7b4fd5bab4f41eeead85dedbf2ab717d
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Before this commit:
The editor's code was unnecessarily adding an access token to attachments
created from external URLs. This addition of a query string with an access
token to an external URL made no sense and could lead to issues.
After this Commit:
This commit prevents such behavior by adding a condition to check if the
attachment is created from an external URL. If so, it will not generate and
add an access token, ensuring the integrity of the external URL.
task-3470982
closesodoo/odoo#148646
X-original-commit: e5d464660f29a3b0b2af1c0ed534b63f81f1b10d
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Sanjay Sharma (shsa) <shsa@odoo.com>
Before this commit, when an image was cropped in a record on which
multiple users were collaborating, multiple attachments would be created
for the same image (one per user).
Multiple attachments for the same image would also be created if the
user uploaded the same image multiple times in the same record.
This commit makes sure that, when about to create an attachment via the
'add_data', 'add_url' and 'modify_image' routes, if an attachment
already exists for the same field values, the existing attachment is
returned instead of creating a new one.
task-3524601
closesodoo/odoo#148556
X-original-commit: 0e2508388fc03b2ea7a4033e571d289efa4ac479
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Before this commit, when the user was in RTL mode, the row menu UI was
appearing on the right side of the table UI toggler, which would make
it invisible to the user.
This commit fixes the issue by making the row menu UI appear on the
left of the table UI toggler in RTL mode.
task-3664939
closesodoo/odoo#148543
X-original-commit: 25a9c993ff0bdbe30fca1e4306da9018a7ec836a
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Before this commit, the row table UI toggler was positioned on the left
for RTL languages. Since the first TD was on the far right rather than
the far left, it was impossible to click on the row UI. It disappeared
whenever an attempt was made to click on it.
task-3664939
X-original-commit: fbc167bf84340b4bb6d0f8c59f2734814f56c6df
Part-of: odoo/odoo#148543
The border was adding 1px offset that made the o_table_ui children 1px
off.
task-3664939
X-original-commit: cd497d12031bc88c8b62151f432970024ce5ce84
Part-of: odoo/odoo#148543
When converting a card for e-mail client compatibility, we apply the
attributes of the card's block children to their respective cells and
unwrap them. However, that's an issue if the child is an image or a link
since their respective `src` and `href` attributes are meaningless on
the cells.
task-3631900
opw-3580317
opw-3630693
closesodoo/odoo#148529
X-original-commit: d3bdb08c97ad7eab005ac185f393807df35f383e
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Current behaviour before commit:
In website, space before the word is lost when deleting the word.
Desired behaviour after commit:
Now space is preserved when deleting the word.
task-3233352
closesodoo/odoo#148492
X-original-commit: 5f5d12dd1bbdc63a9565aa84f197c4a9bba55d7a
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Before this commit, if a URL was contained in two or more text nodes,
e.g. <p>"link" ".com"</p>, pressing the space key after the URL failed
to convert it into a link. Such text node split can happen as a result
of backspace or delete in the middle of a text node.
This commit makes sure adjacent text nodes are merged before searching
for a URL in its content.
task-3468763
closesodoo/odoo#148362
X-original-commit: 04f9a90127eac2a403ffe77d1e90dbe659a8fa42
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
Before this commit, the link preview in the Link Dialog would not be
updated after changes on the label input field, depending on other
actions to be updated (e.g. picking a different type of link/button or
changing the URL input field).
This commit makes sure the link preview reacts to changes on the label
input field.
task-3580621
closesodoo/odoo#148202
X-original-commit: c7954225e8680821a46c9628e5e05df2ae575da7
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
*: website
When the user uploads an image and remove the original image, some
image options continue to work thanks to a backend fallback on another
image. Unfortunately, this fallback is not available for images coming
from unsplash. This commit fixes this issue by preventing the UI to be
blocked when the original image is not found.
Steps to reproduce the bug:
- Activate the developer mode
- Configure Unsplash in the settings
- Add a Cover block on a page
- Replace the background image with an unsplash image
- Save
- Edit the page and via the media dialog, remove the original image
=> The options on the image cannot start anymore.
opw-3636499
opw-3474103
closesodoo/odoo#148197
X-original-commit: 3b0ac160a800f70ae965b60110e83e41655bca5f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Before this commit:
When inserting a star rating element, pressing 'Enter' would move the cursor
to the next line, and hitting 'Backspace' would delete the star rating element.
After this commit:
After inserting a star rating element and moving to the next line with 'Enter,'
pressing 'Backspace' now causes the cursor to move to the previous <p> tag
where star element is located. If 'Backspace' is pressed again, the star
element is deleted.
task-3555394
closesodoo/odoo#148198
X-original-commit: 64a1b38450e15162f89d370fbe30abda9e5f7fe7
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
The "grid images" are grid items that only contain an image (i.e. the
image is alone in its column). This distinction with other images in
grid mode allows to set the `object-fit` CSS property to `cover` so they
take the whole space of the grid item (see commits [1] and [2]). In
commit [3], the "Position" option has been added, allowing to switch
between the `cover` and `contain` values for this property, to have the
possibility to still choose to display the entire image, so it can keep
its ratio.
However, only the images that are direct children of the column have
been considered when checking if it was a grid image and in the related
CSS rules. This means that an image with a link cannot be one, since
the image is the child of an anchor element `<a>` in that case. It can
therefore not be set as "cover" or have the "Position" option.
This commit adds the support for images with a link set on them, so they
can be considered as grid images too.
Steps to reproduce:
- Drop the "Masonry" snippet.
- Click on the image and set a link on it.
=> The image is now "contain" and the "Position" option disappeared from
the right panel so we cannot change it.
[1]: https://github.com/odoo/odoo/commit/e9c7e020daf88022d6e02de0a5620074e8417b5a
[2]: https://github.com/odoo/odoo/commit/d8c374e3e6b31bf88aa42952aadf3379936f7600
[3]: https://github.com/odoo/odoo/commit/faf19ef7f87fc043fb9a814516e01b8eeafd9b61
opw-3580128
closesodoo/odoo#148022
X-original-commit: 085d70cea571ea80c141ac6005e8bd8333bd269f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Minor fix: the background grid is not observed in the first place,
setting a z-index on it should not be observed either.
Noticed when fixing `automaticStep(Un)active()` at [1].
[1]: https://github.com/odoo/odoo/commit/c2d952689c97add74a372c90aa18787094d5d93a
Related to task-3576046
closesodoo/odoo#147970
X-original-commit: 901ed6d8c6c6bdb8aff8e9366d63bba59051019a
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Current behaviour:
When changing the text color in the document layout
of the company to one of the first row colors,
the text stays black in the preview of the document.
Steps to reproduce:
1. Go to Settings
2. Click on Configure Document Layout
3. In Company Details, highlight the text
4. Change the font color to any of the first row
5. (By example the color #35979c)
6. The text color in the preview is still black
7. (Same when exporting to PDF)
Cause of the issue:
The css code for colors in top row (o-color-1 to 6)
is generated in web_editor (.text-o-color-1 to 6)
and was not in the report_assets_common bundle
See https://github.com/odoo/odoo/blob/01b42c7d76c814e13325f8880dc9de765b0f43c8/addons/web_editor/static/src/scss/web_editor.common.scss#L662
opw-3360456
closesodoo/odoo#147645
X-original-commit: 0b914f3d0dc209ca87837feb15e6ec3f063be534
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>