Before 8557bcf the URLs were never rewritten for multilang, which was an
error and could duplicated the number of requests on frontend.
Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is
used to parse the URLs (this is similar to python parsing URL but works
in python2 and python3 the same), and in this particular instance it
chooses that tel:800800 is website http://tel:800800 and not a telephone
number.
The problem is when the url uses the uri 'tel:' and only numbers as a
phone number, if the user uses the global format for telephone number
(with the +) or using a separator for the numbers (e.g. '-' , '/'), in
these cases there are no problems parsing the url (phone number RFC:
https://tools.ietf.org/html/rfc3966).
This commit changes the uri 'tel:' to 'tel://' this one is correctly
parsed by the werkzeug library.
opw-2029844
closes#34306closesodoo/odoo#34586
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- To enable loop on a video, only setting the 'loop' URL parameter
to 1 will not work anymore. We also need to set the playlist parameter
to the video ID.
- Sound is no longer allowed in autoplay because of new autoplay
policies of most browsers. To make autoplay work, the video must be
explicitely muted.
closesodoo/odoo#34323
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When we add a document with the "Select a Media" modal, if we reopen the
modal then click on "Save" without modfiying anything, the element is
broken since we do not have the data saying it is a document and the
code try to display it as image.
With this changeset, we keep the information that the attachment is a
document and when saving it works as expected.
opw-2004064
closes#33844
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.
The traceback is a execute `setEnd` on `Range`, that error is thrown
because editable DIV doesn't save old range
Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.
After this commit, editable div will use newly created range for the element
for ex:
-> content: test
-> selected content "test"
when click on link dialog:
ec: test , eo: 4, sc: test, so: 0
selected content -> start 0, end 4 -> "test" like this
after clicking on discard:
ec: null text element, eo: 4, sc: null text element, so: 0
selected content -> ec and sc both are null, so it will throw an error
while setting cursor position
after applying fix when click on discard:
ec: test, eo: 4, sc: test, so: 0
selected content -> start 0, end 4 -> "test"
task - 1955863
closesodoo/odoo#33692
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When you open the image modal of the website editor the selected image
is the current image.
But if the image is not an attachment with an `url` field set (eg. it
has been uploaded and is not a file in a /static/ folder) the match
between image modal and current did not work and to close it we need to:
- actively select the current image then click "Save"
- use the X button to close the modal without saving
With this changeset, the match of current image with image list is done
on the attachment `url` and if unavailable with /web/image/ID/name.jpg
path which cover both possibilities.
opw-2004073
closes#33799
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.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>
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>
When an inline editor is eg. in a form view, the focus is always stolen
by it.
This is because we trigger a mouseup on the editor to update its
toolbars values and informations.
note: backport of 11.0's 7a453b0b7a
In 10.0 this trigger could cause a "blur" which in some instance is not
wanted (eg. inside a newline of a list view).
opw-1906581
closes#31078
The html widget automatically replace an empty field value by
`<p><br></p>` to be able to add content.
But this may cause unintended "onchange", since the value has "changed"
and the onchange themself could cause error when triggered at the wrong
time (eg. inside a list view with required fields).
With this changeset, the onchange is averted when the value was false
and is now `<p><br></p>`.
opw-1906581
closes#31078
When dropping a snippet into a page, it is dropped in the drop-zone
which is the nearest of the user cursor. When moving a snippet, that
condition did not apply and the user was required to put the cursor at
the exact location of the drop-zone.
Also, for both drag and drop features, the drop zones which appeared
were not displayed correctly for full width columns, which made dropping
sometimes impossible when multiple col-*-12 were below each other.
task-1937758
closesodoo/odoo#30899
When creating a banner using the web editor, the targeted image
appears centered in the editor but is aligned on the left in the
email.
The issue also happened with other alignment (left in a centered
widget, right, ...) for example on outlook 2007 and should be solved
with this changeset.
opw-1904827
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
closes#29985closesodoo/odoo#29214
* web_editor
When an user saves its website, all the animations are destroyed so that
a clean DOM is saved. This is particularly important for snippets like
the latest post one that would crash the page if not cleaned before
saving.
Two cases were found where animations were not cleaned before saving and
this is what this commit fixes:
- When an user used the undo/redo system, all animations were lost as
the DOM is recreated.
- When an user duplicated a snippet, animations were not restarted on
the cloned element.
closesodoo/odoo#29159
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.
The traceback is a DOM `IndexSizeError`, that error is thrown when the
boundaries of a DOM Range (`document.createRange`) are outside of the
ranged elements. In this context, the error happens because the element
is empty and the range has an end bound set to the size of the selected
text.
Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.
opw-1981751
closesodoo/odoo#33257
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Commit 42530b02fe was fixing a bug in reports that were using the standard
bootstrap fonts instead of the changes we made in $font-family-sans-serif
To solve this, 42530b02fe replicated the change in the file
web_editor/static/src/scss/bootstrap_overridden.scss
which is imported in report_assets_common **before** web._assets_bootstrap
This was solving the issue for the report but had also the side-effect of
changing body font-family in enterprise as the bootstrap_overridden.scss file
is also used in web_editor._assets_backend_helpers and
web_editor._assets_frontend_helpers
42530b02fe had effect only on enterprise where the desired font is Roboto/Noto
Create a new bootstrap_overridden (6th of the name) file only for report
closesodoo/odoo#32902
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When dragging a snippet in the editor, drop zones are created at the
correct locations (e.g. between columns when dragging a column). Some
code is in charge of "cleaning" the created drop zones to, for example,
remove multiples ones which are at the same position. This code is also
currently removing the drop zones which are between two "non-block"
elements. This is preventing to swap form rows thanks to the form
builder as rows are "non-block" elements as they are flex elements.
This commit solves the problem by changing the "is non-block" condition
to "is inline" condition which is what was intended.
Note 1: rows became flex elements with BS4, that is why this is fixed
in 12.0.
Note 2: this could be back-ported in previous stable versions as this
actually preventing to drop snippets between tables, list
items, etc (all non-block elements) but this can be considered
as a limitation unless a real breaking case presents itself.
See task-1874350 which discovered the bug.
closesodoo/odoo#33054
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Have a fieldHTML as:
```
<p>
Some text
<br>
<br>
More text
</p>
```
In the Html field widget, place your cursor before the "M"
press Enter to insert a newline
Before this commit "Some text" and the subsequent `<br>` were deleted
This was because the code:
- split the original `<p>` into two
( i.e. it became
```
<p>
Some text
<br>
<br>
</p>
<p>
More text
</p>
```
)
- took the last child of the first p, which is a text then fell back to the first p
- replaced the whole p with <br>
After this commit, the original p is still split, but we append the br to it instead of replacing it
closesodoo/odoo#32777
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Fixesodoo/odoo#27487
Noto Color Emoji produces an error on wkhtmltopdf, cf
wkhtmltopdf/wkhtmltopdf#4149
In the backend assets, the $font-family-sans-serif is changed in
web/static/src/scss/bootstrap_overridden.scss
In the reports assets, the $font-family-sans-serif was NOT changed in
web_editor/static/src/scss/bootstrap_overridden.scss
The default boostrap fonts were still used in reports, ignoring the changes made
for backend.
closesodoo/odoo#32312
Signed-off-by: Martin Trigaux (mat) <mat@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>