Commit Graph
1036 Commits
Author SHA1 Message Date
Christophe Simonis 7b74f4ca9a [MERGE] forward port branch saas-11.3 up to 1debaa89f1 2019-07-04 18:57:17 +02:00
Christophe Simonis 1debaa89f1 [MERGE] forward port branch 11.0 up to 56ce29e71f 2019-07-04 17:35:07 +02:00
Jorge Pinna Puissant 56ce29e71f [FIX] web_editor: tel url in werkzeug parser
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 #34306

closes odoo/odoo#34586

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:50:50 +00:00
Kishan Gajjar 5d4e75ae58 [FIX] web_editor: restore broken VideoDialog options
- 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.

closes odoo/odoo#34323

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-28 15:38:31 +00:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02:00
Nicolas Lempereur 7c900568c5 [FIX] web_editor: modal open>save document keep it
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>
2019-06-03 13:54:45 +00:00
Priyanka Kakadiya 0799742d05 [FIX] web_editor: restoreRange on invalid node
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

closes odoo/odoo#33692

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 05:36:08 +00:00
Christophe Simonis 9e9e9acef1 [MERGE] forward port branch saas-11.3 up to a2582c4252 2019-06-07 19:04:43 +02:00
Nicolas Lempereur 9e6f3abead [FIX] web_editor: image modal nochange close on save
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>
2019-05-31 13:26:50 +00:00
Christophe Simonis 4c61621efb [MERGE] forward port branch 11.0 up to 9a7e3c8b49 2019-04-08 17:45:00 +02:00
Christophe Simonis e9068c290b [MERGE] forward port branch 11.0 up to 0196a6feb5 2019-03-25 16:47:05 +01:00
Nicolas Lempereur e1b1d3cd1b [FIX] web_editor: no lose tooltip on selection
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>
2019-04-08 08:17:57 +00:00
Christophe Simonis e3f5f17561 [MERGE] forward port branch saas-15 up to 214e819c1b 2019-04-04 20:07:27 +02:00
Christophe Simonis 214e819c1b [MERGE] forward port branch saas-14 up to 6e0c89867e 2019-04-04 19:34:35 +02:00
Christophe Simonis 6e0c89867e [MERGE] forward port branch 10.0 up to 60592561d7 2019-04-04 18:33:42 +02:00
qsm-odoo 60592561d7 [FIX] web_editor: support youtube-nocookie.com
closes odoo/odoo#32332

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-04 09:21:09 +00:00
qsm-odoo 36289e77ba [FIX] web_editor: restore theme responsive spacing
The factor parameter of the mixin in charge of generating the spacing
classes was not correctly used.

closes odoo/odoo#31996

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-20 15:48:34 +00:00
qsm-odoo 92f8a3c9ef [FIX] web_editor: review drag and drop in the editor
Forward-port of https://github.com/odoo/odoo/commit/be689c53c13330832510c8cef332ac862d4ed5e8
was missed from 11.0.

closes odoo/odoo#31971

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-20 10:15:49 +00:00
qsm-odoo 2a39ab0579 [FIX] web_editor: handle snippet option submenus of submenus
Commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
did not think about submenus inside submenus, which is the case in the
website animate option. This made snippets potentially have multiple
animations on them, with undesired behaviors.

This commit also accordingly reviews the _setActive method for the
select-class option and also adapts following the recent forward-port of
https://github.com/odoo/odoo/pull/31440

Related to task-1929133

closes odoo/odoo#31477

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-15 13:58:50 +00:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
qsm-odoo 395c169db9 [FIX] web_editor: wait for animation end before covering snippets
Part of https://github.com/odoo/odoo/pull/31440
opw-1929133

closes odoo/odoo#31440
2019-03-01 13:52:14 +00:00
qsm-odoo 8405c7f5fa [FIX] web_editor: properly check snippet options
Commit https://github.com/odoo/odoo/commit/c2b8d2a3017256e4ea60a3710bdaab6d1f693d81
made the mistake of considering each dropdown-menu individually while
all are considered to be the same when enabling a class. From saas-11.x,
commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
will group by dropdown menu but that will be another fix to make.

Part of https://github.com/odoo/odoo/pull/31440
opw-1929133
2019-03-01 13:52:14 +00:00
Christophe Simonis c0f24d54cf [MERGE] forward port branch saas-14 up to c1fe9f18d5 2019-02-14 18:14:08 +01:00
Christophe Simonis c1fe9f18d5 [MERGE] forward port branch 10.0 up to 69719f598a 2019-02-14 18:09:24 +01:00
Nicolas Lempereur 0857737f8c [FIX] web_editor: focus lost with inline editor
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
2019-02-13 17:21:19 +00:00
Nicolas Lempereur 1e43c73a99 [FIX] web_editor: html widget empty value stay empty
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
2019-02-13 17:11:13 +00:00
Christophe Simonis 728bb2a28e [MERGE] forward port branch 11.0 up to 9553240adc 2019-02-08 19:19:57 +01:00
Christophe Simonis 9553240adc [MERGE] forward port branch saas-15 up to 9773be345e 2019-02-08 16:53:11 +01:00
Christophe Simonis 9773be345e [MERGE] forward port branch saas-14 up to 18228f9c4e 2019-02-08 13:28:46 +01:00
Christophe Simonis 18228f9c4e [MERGE] forward port branch 10.0 up to be689c53c1 2019-02-08 11:40:01 +01:00
qsm-odoo be689c53c1 [FIX] web_editor: review drag and drop in the editor
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

closes odoo/odoo#30899
2019-02-07 11:12:36 +00:00
Lucas Perais (lpe) b87879c1f6 [FIX] web_editor: icon widget complies to api
the search method should return a Deferred as explicit in MediaDialog

OPW 1919549

closes odoo/odoo#30077
2019-01-09 14:32:04 +00:00
Christophe Simonis b50883d17b [MERGE] forward port branch 11.0 up to c07b7200b2 2019-01-08 11:52:15 +01:00
Julien (juc) Castiaux fce729e65a [FIX] web_editor: banner not horizontaly centered
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 #29985

closes odoo/odoo#29214
2019-01-07 13:49:33 +00:00
Christophe Simonis d4c65a7ede [MERGE] forward port branch 11.0 up to 2156af480f 2018-12-04 17:11:57 +01:00
qsm-odoo a153ed42a0 [FIX] website, *: properly clean website widgets
* 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.

closes odoo/odoo#29159
2018-11-29 16:41:33 +00:00
Christophe Simonis b09f624f20 [MERGE] forward port branch 11.0 up to 263b388c50 2018-11-22 17:52:57 +01:00
Christophe Simonis 263b388c50 [MERGE] forward port branch saas-15 up to e44c35f407 2018-11-22 17:06:31 +01:00
Christophe Simonis e44c35f407 [MERGE] forward port branch saas-14 up to a9752d3ad3 2018-11-22 15:03:01 +01:00
Christophe Simonis a9752d3ad3 [MERGE] forward port branch 10.0 up to af476c6949 2018-11-22 14:39:08 +01:00
Julien Castiaux 538f99ccce [FIX] web_editor: restoreRange on invalid node
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

closes odoo/odoo#33257

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-05-09 13:53:22 +00:00
Martin Trigaux 60d6c5402b [FIX] web: change bootstrap fonts only for reports
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

closes odoo/odoo#32902

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-30 08:19:38 +00:00
qsm-odoo eb5e8d660a [FIX] web_editor: allow d&d of blocks between flex elements
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.

closes odoo/odoo#33054

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-30 13:07:16 +00:00
Lucas Perais (lpe) 2830b93a3a [FIX] web_editor: insert br within a p
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

closes odoo/odoo#32777

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-17 12:45:52 +00:00
Martin Trigaux 42530b02fe [FIX] web_editor: override fonts in reports
Fixes odoo/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.

closes odoo/odoo#32312

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-15 12:14:40 +00:00
Christophe Simonis fef49061ea [MERGE] forward port branch saas-11.3 up to 4c61621efb 2019-04-08 19:52:29 +02:00
Christophe Simonis 11b1e12cde [MERGE] forward port branch saas-11.3 up to e9068c290b 2019-03-25 18:28:16 +01:00
Julien Castiaux e9026bd522 [FIX] web_editor: editor hang on an infinite loop
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

closes odoo/odoo#32014

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-21 13:45:12 +00:00
Christophe Simonis bd63913326 [MERGE] forward port branch saas-11.3 up to 4e39328a76 2019-03-18 20:03:24 +01:00
Gorash 05c095a73b [FIX] website: edition of links on safari and firefox is now possible
closes odoo/odoo#31629

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-07 16:03:03 +00:00