Steps to reproduce:
1. add a paragraph
2. add a blockquote
=> the cursor will jump in the paragraph
This commit fixes a bug detected when inserting a blockquote. The cursor
jumps to nearby paragraph on insert, and other issues.
The cause of the bug is tied to the fact that we rely on a complex behavior
when inserting paragraph related elements (within the insert command).
The way to make blockquote behave like the other paragraph related
elements is simply to add it to the list as done in this commit.
Task-3383441
closesodoo/odoo#134700
X-original-commit: 8195beacbd878c56bc93290bc03665e30667e177
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
In order to fix wrong url recognition, improve the url REGEX by:
- Recognize an url with a dot at the end in the string
`www.google.be.`. It was not recognized before this commit.
- Do not allow a special character after an url that is not
separated by "/", "?", or "#". Before this commit, the content
`www.google.be!` would have been recognized the url as
`www.google.be!` instead of `www.google.be`.
- Do not include in the url some character if they appear at the end.
The chars are:
- .
- ,
- }
- )
- ]
- '
- "
task-3373367
closesodoo/odoo#134660
X-original-commit: 0327ed28e855c89f9c13266c4aba5c99d80263ac
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
PURPOSE
The main reason is that when there are two block side by side that are
not editable (eg. the `HR` tag, the `/template` block), it is impossible
to set the cursor in between to add more content.
task-2984709
closesodoo/odoo#105179
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
In order to use the class outside a legacy context, this commit
convert SmoothScrollOnDrag into a regular class.
task-2984709
Part-of: odoo/odoo#105179
- Add the ability to add a container to a tree of absolute containers
- Draw the avatars and the avatar overlaps in their own containers
- In order to clearly understand what draws the user avatar and a
selection, create the method _drawUserAvatar.
task-2984709
Part-of: odoo/odoo#105179
In this commit, the loadXML function has been removed. We use registry with
xml_templates to load XML templates for OWL Apps.
The goal of task is to remove loadXML and getBundle from assets to simplify
the understanding of assets api.
task-3266441
closesodoo/odoo#134520
Related: odoo/enterprise#47001
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Current behaviour before commit:
-When pasting copied content from editor inside
link inserts text with HTML content, in result
the pasted content seems isolated from the link.
e.g. <a href="#">te[]st</a>
+ pasting <h1>123</h1> <=>
<a href="#">te<h1>123</h1>st</a>
Desired behaviour after commit:
-Now only text content is pasted which makes
pasted content as a part of the link.
e.g. <a href="#">te[]st</a>
+ pasting <h1>123</h1> <=>
<a href="#">te123st</a>
closesodoo/odoo#134516
X-original-commit: 1cc3354b88658620c15fa18427b8725b6215337d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit allows you to change the icons of custom links of the social
media block after the first save. Thanks to [this other commit], there
is now a class that permits to inform the editor that a media is
editable even if it is a non-editable parent. This commit permits to use
the new class to fix the issue.
Steps to reproduce the bug:
- Drop a social media block on a page
- Add a custom social media
- Save
- Edit
- Try to change the icon of the custom social media with a double-click
=> The icon cannot be changed.
Note that [another commit] had already been made and fixed the problem
halfway (the icon change didn't work on double-click). This commit
reverts it and fixes the problem correctly with the new system.
[this other commit]: https://github.com/odoo/odoo/commit/6ead397f33512c918f51feb2b32fb3e15ffedf34
[another commit]: https://github.com/odoo/odoo/commit/bb291b35e46e42ca098aa3e04ac0b473f72be423
Fixes https://github.com/odoo/odoo/issues/104048
task-3073171
X-original-commit: b844351b9814ff2167d2183ab3216e2d1ec1d216
Part-of: odoo/odoo#134281
In the frontend of project, the bus service is not available.
Since #129785, the test `portal_project_sharing_tour` crash
because `this.busService` is `undefined` when we try to access
it in `Wysiwyg.setupCollaboration`.
task-3434068
closesodoo/odoo#133477
Related: odoo/enterprise#46479
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
* A delete at the end of an empty block just before a table (unbreakable), nothing happened.
After this commit:
* A delete at the end of an empty block just before an unbreakable block, the empty paragraph should be removed and the selection put at the beginning of the unbreakable block.
task-3186679
task-3252775
closesodoo/odoo#125211closesodoo/odoo#134327
X-original-commit: 70a03c931438fd549d167deb9ad500f3fc8b6024
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Before this commit:
* A backspace at the beginning of a List Item (LI), the indentation of the list item was reduced by 1 unit.
If not possible, the current LI was merge with the previous LI.
* A delete at the end of a LI, first we remove one unit of indentation from the next LI,
only when not possible anymore we merge next LI in the current LI.
After this commit:
* A backspace at the beginning toggle off the current LI ( the LI tag is remove and popped out of the List )
The parent List is splitted if needed.
* A delete at the end of a LI directly merge next element inside the current LI.
task-3186679
X-original-commit: b177c29ee0df8c7edf72b177c59c5dff6bd0d270
Part-of: odoo/odoo#134327
Co-authored-by: Aashish Thakur <aath@odoo.com>
Before this commit:
On backspace current node is removed and it's content were moved to it's
preceding node.
After this commit:
Now keeping the current node it removes preceding node if empty and if not empty
then merge current node to previous node.
Task-2909314
task-3186679
X-original-commit: bca7f0455ce56268a592c924ac22f9f2dc6541db
Part-of: odoo/odoo#134327
Co-authored-by: Sanjay Sharma <shsa@odoo.com>
*:web_editor,portal
This commit aims at removing the need to rely on `$.browser`, which was
mainly the case to support deprecated and unsupported browsers like MS
Internet Explorer or old version of Firefox.
Doing so, this commit removes the `data-browser` attribute initialy
introduced by odoo/odoo@a7e0b73930 as not
needed anymore nowadays and to generally promote "feature detection"
instead of "user-agent sniffing" to handle browsers' feature support and
edge cases.
task-3439226
Part-of: odoo/odoo#133916
This commit adds an "on hover" option for animations. We've added the
"on hover" option to the animation selector. This feature is only
available for images. It allows you to pick an animation that triggers
when you hover your mouse over an image. There are six different
animations to choose from. This new animation option doesn't work with
animated shapes and devices shapes.
task-3094258
closesodoo/odoo#119197
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit adds the possibility to horizontally/vertically mirror and
rotate the shape of an image. We've introduced a new sub-option for
image shapes called "Transform". This new option is not available for
certain shapes:
- If the transform will have no effect (a vertically and horizontally
symmetrical shape).
- With some animations, if the animation is too complex for the system
to work.
- For "devices" shapes because they are too specific for the option to
work. And anyway "devices" shapes are already available horizontally
flipped in the list.
task-3094258
Part-of: odoo/odoo#119197
Steps to reproduce the problem:
- Go on the "Courses" application and select a course.
- Edit.
- Replace the main image of the course with one of your own.
- Save.
-> The function route `/web_editor/modify_image/` is called two times
leading to the creation of two attachments instead of one.
The `savePendingImages()` function iterates through editable elements
and calls `/web_editor/modify_image/` (through `_saveModifiedImage()`)
for each image with a `o_modified_image_to_save` class inside those
elements. In our case, the image has an editable element parent that has
itself an editable element parent. Because since [1], the
`o_modified_image_to_save` class is removed after the `rpc` call, this
class is not removed while the `savePendingImages()` loops on the
second editable element parent of the image. As a result,
`/web_editor/modify_image/` is called two times. Note that before [1],
the process was partially wrong as well. `/web_editor/modify_image/` was
indeed called only once but with the wrong arguments. This is now fixed
by ensuring that `_saveModifiedImage()` is called with the arguments
coming from the closest editable element. The same logic is applied for
the call of the `_saveB64Image()` function.
[1]: https://github.com/odoo/odoo/commit/8872aab2d108ff3e2ec06ca4579479898c87738c
task-3451349
closesodoo/odoo#134189
X-original-commit: 8ff0151cf06c37e8ee2e344bc96c063b4921ce43
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
Before this commit, when the browser was offline and when an attempt
to make a RTCPeerConnection was made, a traceback was raised by
firefox:
> InvalidStateError: Can't create RTCPeerConnections when the network is
> down
This commit prevents the creation of the RTCPeerConnection when the
browser is offline.
task-3186872
closesodoo/odoo#134236
X-original-commit: 8f9a3e1ebd05d9df8ec0d82b93967f1a62f879c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Re-open the colorpicker.
- Bug: The colorpicker is empty.
This bug occurs since [1] because the 'selectedTab' option of the
colorPalette was being reset to its default value when the colorPicker
was opened for a second time. In this commit, we stored the
'selectedTab' props in a variable to be able to modify it (see the owl
[documentation]).
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
[documentation]: https://github.com/odoo/owl/blob/master/doc/reference/props.md#good-practices
task-3440939
closesodoo/odoo#134229
X-original-commit: 2094a52647ce1c321d1e703d96211fc0d642025f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
As tempusdominus relies on jQuery, we have written our own date(time)
picker in owl. This commit converts the remaining uses of the
tempusdominus date(time) picker and replaces them by our own.
closesodoo/odoo#133349
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Crop widget is implemented as div block that is supposed to be displayed on top
of other elements. However, it's not the case for dialogs, because they want to
be on top as well (z-index of dialog is 1050 bootstrap [1])
STEPS:
* Go to Sales Order
* SO
* Schedule an activity
* Use '/' command
* select image
* click image
* crop image
BEFORE: image crop toolbar is hidden behind 'Schedule activity' Pop-up
Fix it by increasing z-index for the crop widget
[1]: https://github.com/odoo/odoo/blob/9102df15cce455205a19fb7b9a0c36186cc51e3a/addons/web/static/lib/bootstrap/dist/css/bootstrap.css#L5524
opw-3391583
closesodoo/odoo#133781
X-original-commit: 36c9b2b7916fbbdcfc912d652695699e50043edb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Since [1], many tickets were created because of a crash preventing any
action in edit mode. This actually occurred in most databases were
snippets were saved previously (which probably is most old-enough ones).
Steps to reproduce on a fresh DB:
1. Enter edit mode
2. Drag and drop a snippet which contains an image, like "Text - Image"
3. Click on the image once (a tooltip asks to double click)
4. Save the snippet (not the page, floppy disk icon in the right panel)
=> You cannot do anything in edit mode ever again.
This is actually a combination of 2 bugs:
A. On step (3) in the steps above, the image receives the
"aria-describedby" attribute related to the tooltip... and it never
disappears (if the page is saved, the attribute is saved with it).
When saving the snippets we should probably clean such problematic
attributes to be sure anyway too.
B. Because of [1], the snippets saved by the customers and which
contain the problematic "aria-describedby" attribute are now the
source of a crash: we try to hide the related tooltips... even
though there is none, which causes a crash.
This commit focuses on fixing (B). (A) will need to be fixed later,
probably in an earlier version anyway.
[1]: https://github.com/odoo/odoo/commit/095721a9cace476c3eae445c7abd8f8b458aea36
opw-3475051
opw-3481944
opw-3482170
opw-3483220
opw-3483829
opw-3483837
opw-3484069
opw-3484647
opw-3484950
opw-3485343
opw-3485612
opw-3485623
opw-3485704
opw-3486096
opw-3486425
... and many more
closesodoo/odoo#133707
X-original-commit: 824be46dded7efacf2a351b78e723aa9e205b60d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since [this commit], it's now possible to edit a media when it's in a
parent that is not editable thanks to `o_editable_media` class.
Unfortunately, these changes make the new class bypass the potential
`data-exclude` defined in the XML option declaration. So if the target
looks like that:
```html
<img class="o_editable_media odoo"/>
```
and the XML option declaration has a `data-exclude=".odoo"`, the option
will still be displayed. This commit corrects the way the
`o_editable_media` class works, so that it only bypasses the
`.o_not_editable` but not the entire exclude.
[this commit]: https://github.com/odoo/odoo/commit/580f1b77ce0b96b7efbf83a0ccdf6979bbf0e904
task-3476644
closesodoo/odoo#133663
X-original-commit: f73734557116a348ac14b2724e1380546192ca12
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Since [this commit], some throttle calls have been replaced by debounced
calls. This commit modifies those calls in three cases.
The first case is to adapt the overlay covering when the window is
resized or content changes. Note: to reproduce the problem, you might
have to use a test tour for example, as the last operation has to be
done really quickly.
Steps to reproduce the problem:
- Go on a product page.
- Double click on the product image and replace it by one of your own.
- Quickly click on the "Remove" button to remove the product image.
-> Problem: In the `ReplaceMedia` option, the call to `destroy()` (due
to the change of target) is done after the call to `removeMedia()`.
A race condition appears here as since [this commit], the function
`updateCurrentSnippetEditorOverlay()` (responsible of the destroy of the
options whose `$target` are not in the DOM anymore) is debounced and not
throttled anymore. This is a problem for two reasons:
- We do not want the first call to the function to be deferred.
- We want this function to be executed at least at a certain rate if
there are a lot of `content_changed` events recorded in a short period
of time.
This commit also removes the call to a debounced version of a function
at a `mouseup` event in the context of the `ColorpickerWidget`. Indeed,
while the use of a debounced or a throttled version of a function is
totally justified at a `scroll` or a `mousemove` event, it is not in the
case of a `mouseup` event as the occurrence of this kind of event can
not be very high over a give time period.
Finally, this commit restores the use of a throttled version of the post
animation cover.
This can be justified by the fact that we want the post animation cover
function to be executed at least at a certain rate if there are a lot
transition or animation end events recorded in a short period of time.
[this commit]: https://github.com/odoo/odoo/commit/f4f0f783183507df8227b37fe1234c256325df6d
task-3111601
X-original-commit: 4c9eb9589e81b02945618195fbe12a4dd0ab9a50
Part-of: odoo/odoo#133546
Steps to reproduce the bug:
- Go on a product page of a product with multiple variants but no image
set for those variants. Because there is no image set to those variants,
the variant images fall back on the template image.
- Edit.
- Click on the variant image of the product. (Note that `.o_dirty` is
added to the element).
- Save.
-> The image of the product is not the template image anymore but a
variant image that is the same as the template image.
Because `.o_dirty` is added while clicking on the product image,
`save_embedded_field()` will set the `image_1920` field of
`product.product`. Because the product has multiple variants, the
`image_variant_1920` field of `product.product` is modified see
(`_set_template_field()`).
The problem is that the `o_dirty` class is added on the clicked element.
To solve the problem, the `MutationObserver` responsible for adding this
class is paused when modifying the tooltips. Note that it was introduced
by [1] but it was broken since [2].
[1]: https://github.com/odoo/odoo/commit/9f93fa8e77b11da2fcf60f606784eec49a94778a
[2]: https://github.com/odoo/odoo/commit/8eb0ca54200f0f8e1078bb6a0d507e747ccea122
task-3111601
X-original-commit: 3b8f601f95845d65a515e9c8bb8e25cc17565dbf
Part-of: odoo/odoo#133546
When the editor is displayed in a modal, the floating toolbar needs a
higher z-index than the modal in order to be visible. This is due to the
fact that the toolbar is mounted on the 'body' element (therefore, behind
the modal in terms of z-index).
The mobile toolbar, on the other hand, is mounted as a sibling of the
editable's element, which means it is always visible when the html field
is in a modal, without the need for a z-index. In fact, the mobile
toolbar, being fixed (no auto-hide) and having a z-index higher than
modals, leads to the undersired effect of being visible over modals that
are displayed on top of the html field. An example can be seen in the
Project app, where the editor is inside the task's description tab and a
modal can be opened for the customer.
This commit fixes such undesired visibility of the mobile toolbar over
modals by not applying the z-index to the toolbar when it's not
necessary (when not a direct child of the 'body' element).
task-3263463
closesodoo/odoo#133459
X-original-commit: ae569fd97737bc3fe02f12531857b8cc416c80e6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit the floating toolbar would scroll over the headers
above the html field, such as the form view header and the web client
navbar.
This commit ensures the toolbar is hidden when it overflows the scroll
container.
task-3263463
X-original-commit: 96d180c7591bcb359c5b74796f39c0e36ea541fa
Part-of: odoo/odoo#133459
Before this commit the floating toolbar position was not being updated
on scroll events in certain scenarios. The problem resulted from adding
the event listener to the incorrect scroll container, which was
calculated only once in the Wysiwyg life cycle, on start.
The calculated scrollable container could be incorrect due to:
- changes in the web client resulting from the swich from read to edit
mode taking place after the Wysiwyg was started,
- changes in the web client resulting from a window resize (particularly
when, in the form view, the chatter switches position from right to
bottom and vice-versa),
- the editor being mounted inside an iframe and the scroll container
being an element in the top document.
- the editor being mounter inside an iframe and the scroll container
being the iframe's root element.
This commit solves the issue by detecting scroll events anywhere in the
document (and in the iframe's document when it applies) and updating the
toolbar position when the editable is a descendant of the scrolled
element.
task-3263463
X-original-commit: 5382c995eecfe2fcea39d9456860b48704645c99
Part-of: odoo/odoo#133459
This commit removes the legacy session and adapts the modules where it
was used.
task 3439226
closesodoo/odoo#133153
Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit, the "style-inline" option was misspelled as
"styleInline", resulting in setting the Wysiwyg "inlineStyle" option as
undefined. This broke functionality that depended on such option, such
as disabling the convertion of pasted/dropped base64-encoded images to
attachment for mail compose.
OPW-3448851
closesodoo/odoo#133406
X-original-commit: 4ec687366eca1e05716fe93dad77eef5a9981153
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
Before this commit:
Remove Block tooltip gets stuck after click and mousemove.
After this commit:
Remove Block tooltip hides as mousemoves.
task-3432060
closesodoo/odoo#132888
X-original-commit: 095721a9cace476c3eae445c7abd8f8b458aea36
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
If the user is using the `note` or any other module to add and modify images,
and they try to crop the image and apply the changes, they may face an error if
they try to crop it again without clicking on `apply changes` and instead click
somewhere outside the image.
steps to produce:
- Install `note`.
- Create a note, add an image in it.
- Click on image to crop it, select the portion you want to crop and then
click on `Apply` to apply changes.
- Select the image again, click on crop icon and then click anywhere outside the
image boundaries.
Error: `TypeError: 'bool' object is not subscriptable`.
Applying this commit will solve the issue because, after applying it, whenever
`modify_image` is called, `datas` will receive the proper source.
sentry-4185609374
closesodoo/odoo#133164
X-original-commit: 0c38bb37e720a3c06f59becbf9bcc78f9f978723
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: web_editor, website, website_sale, website_slides
This commit removes the legacy storage (localStorage and sessionStorage)
and replaces it with the storage coming from browser.
Part of task-id 3439226
Part-of: odoo/odoo#133132
Steps to reproduce:
1. Go to a blog post
2. Add a header
3. Hide the element on desktop and save
4. Click the button to translate the page
When translating a page, `getScrollOptions` is not initialized, which
throws an error when updating invisible DOM, as it could require the
function to be loaded.
This is because `_updateInvisibleDOM` needs this property to be set.
Similar fix: https://github.com/odoo/odoo/commit/62cc16dae74729a805a08f17db8ba75d9c51d096
opw-3430581
closesodoo/odoo#133100
X-original-commit: 233cc3439799d2ecc7342c5f02176cef394e08a7
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
This commit fixes the color of the "replace" buttons on images in the web
editor.
task-3376752
Part of task-3326263
closesodoo/odoo#133091
X-original-commit: a9a89bc54c7c110460382629bd283effdd7eade6
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
There is an undeterministic error while testing the link tools
because `this.linkComponentWrapperRef` is null at the time of calling
`_updateOptionsUI` by the `onWillUpdateProps`.
As using the element for setting the class is not idiomatic in owl,
this commit adapt the code to use `t-att` attribute.
runbot-23346
closesodoo/odoo#132535
X-original-commit: a16c8b8598761808f5cb2a712c6f5808297e48f3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
After convertion of the ImageCrop widget to an Owl component [1], the call
to `this.displayNotification` no longer applies. In fact, it produces a
traceback when trying to crop an image that cannot be cropped
(base64-encoded image not yet converted to an attachment, for example).
This commit replaces such call for the more suitable notification
service's `add` method.
task-3471481
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997closesodoo/odoo#132726
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When inserting a link into mass_mailing document
we need to delay the blur event to prevent the to_inline.
If the to_inline is called when the link dialog is open
the context is lost in the document and the link failed
to be inserted.
task-3234749
closesodoo/odoo#132667
X-original-commit: db38abf259c1a6fed51e8e99785ffea770e9e909
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Steps to reproduce the bug:
- On Chrome, go to the Email Marketing application.
- Enter edit mode to modify a mail template.
- Add a text-image snippet to the template.
- Click on the image.
- Open the shape image selector in the options of the image.
- Scroll through the list of available shapes.
- Bug: A traceback error occurs.
The bug occurs because sometimes, in the 'scroll' function of the
selector, the 'ev.currentTarget' becomes 'Null'. This issue is specific
to Chrome and only happens in the email template editor (not in the web
page editor). It appears that this issue is related to using the
'throttleForAnimation' function for the event, where the value of
'currentTarget' gets lost during various calls.
We fix this bug by avoiding the use of 'currentTarget' in this specific
case. However, further investigation would be required to fully
understand the problem.
task-3431820
closesodoo/odoo#132574
X-original-commit: c799345f6ae81f10a8133688431fe63ed23617ad
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Summary:
page with 2 popups (newsletter popup and regular popup), cookie
bar all justaposed. Chatbot window also open. For some reason
closestBlock(testedNode) is undefined (testedNode) is a #text
Node. Change already in place for 16.3
Cause:
no preventive measure for null value before creating
a node iterator on the value.Node in dom does not have
an ancestor of type block.
Solution:
backport solution from 16.3, return false when currentNodeParentBlock
is null, since preceding and following would also be undefined,
return false.
opw-3395673
closesodoo/odoo#132590
X-original-commit: 8a72f669813bc7d8aa9038d75e08ecef00b70e01
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Pedro Manuel Calheiros Lima de Sousa <peso@odoo.com>
Before this commit:
After applying formatting styles to text that already has some color applied to
it, we encountered an issue where the color pallete would flicker when
attempting to change the color.
After this commit:
Now, the color palette will no longer flicker when trying to change the color of
text that has formatting styles applied to it.
task-3417998
closesodoo/odoo#132561
X-original-commit: 7a9977882b0e9222beba7de23f026de937a60a4d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: web_unsplash
Before this commit, if we were in debug mode, when we tried to replace
or add an image, a traceback appeared when selecting an Unsplash image
for the first time or when uploading an image of size 0 (also for the
first time). Note that once the traceback was closed, it did not
reappear until the page was refreshed, but the progress bar was not
displayed anymore.
It happened because in debug mode, there is a validation of the
different owl components props and some props of the `ProgressBar`
component were not correctly set when adding Unsplash images or empty
image files, causing the props validation to fail. Those props
definition were incorrectly added with [1].
The traceback was not reappearing because the `UploadProgressToast`
component (= the parent of `ProgressBar`) has been destroyed and so the
props validation was not done anymore since the components were not
there.
This commit fixes these issues by correctly setting the `ProgressBar`
props and by adding default props, in order for them to always have a
value when omitted.
Steps to reproduce:
- Activate the debug mode.
- In edit mode, drop the Text-Image snippet.
- Double-click on the image to replace it.
- Type something in the search bar and select an Unsplash image or
upload an empty image file.
=> A traceback appears.
[1]: https://github.com/odoo/odoo/commit/886f3de768b647f4b402c97098abf274d6258f75
opw-3413299
closesodoo/odoo#132377
X-original-commit: 425dfb07f21288caf56bceea3a86e0b7ecac4a91
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this, we were considering only the case where only a single
element is wrapped by the anchor tag, like `<a><img></a>`. So it simply
replaces parent node `<a>` with childNode `<img>`. However, cases like
`<a>text<img><a>` (where there are multiple element within the <a> tag)
were failing.
To handle such cases, this commit replaced the code that considering
multiple childNodes and replacing parentNode with all the childNode.
task-3231606
closesodoo/odoo#132531
X-original-commit: 08432308819e83fd0122a8e87170ec8ff27ca2a1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
In our continued effort to remove legacy code, this commit replaces
usage of the legacy mutex util with the new one, which is fully
compatible as a drop-in replacement. The legacy mutex has been removed.
Part of task-3439226
closesodoo/odoo#131748
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This library provided the `nearest()` and `touching()` methods.
This commit replaces them by our own utility methods from
`@web/core/utils/ui`: `closest()` and `touching()`.
closesodoo/odoo#130818
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :
<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>
task-3292454
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
According to the ECMAScript 2023 Language Specification:
> Module code is always strict mode code.
Odoo Modules mimic this behavior and automatically add “use strict“ at
the top of the file, so there's no need to do it yourself.
This commit removes all the useless occurrences of use strict.
closesodoo/odoo#132235
Related: odoo/enterprise#45908
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, since [1], when an image was pasted or dropped, it
was converted to a public attachment on save.
This was an oversight, and this commit fixes it by creating such
attachment as a private one instead, much like when uploading an image
via the "/image" command.
Attachments created via the website remain public.
[1]: https://github.com/odoo/odoo/pull/128452/commits/1b3877191ee9d97d2c50ccacb41461827b42fd56closesodoo/odoo#131975
X-original-commit: d939fc83ab645ebced6859e04269fb65bf47f323
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>