Commit Graph
1159 Commits
Author SHA1 Message Date
Martin Trigaux 5d57e1862f [MERGE] Forward port of saas-12.4 to master up to beba36416f
closes odoo/odoo#34924

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 15:45:24 +00:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Martin Trigaux 1f5a4649a6 [MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 13:59:35 +00:00
Martin Trigaux fd15ca1918 [MERGE] Forward port of saas-12.4 to master up to 1f5a4649a6
closes odoo/odoo#34850

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:12:26 +00:00
Christophe Simonis 66bb578ac9 [MERGE] forward port branch saas-12.2 up to be5e8fdab8 2019-07-05 16:14:48 +02:00
Antoine Guenet e7828c3627 [FIX] web_editor: properly insert character in empty nested list
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.

closes odoo/odoo#34805

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-07-11 14:41:12 +00:00
Christophe Simonis cf51b5f25d [MERGE] forward port branch saas-12.3 up to 793933a128 2019-06-25 14:23:48 +02:00
Christophe Simonis 78b2063b29 [MERGE] forward port branch saas-12.2 up to 8747d72f1e 2019-06-21 15:16:54 +02:00
fja-odoo 514ecd7563 [FIX] web_editor: fix closing optimize image modal
The optimize modal was adding images to the modal even when closing
without optimizing the image.
Now when we close the modal, no images is append to it, same if we
click on "Keep Original" while optimizing an already existing image.

Part of #33983

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-19 14:55:30 +00:00
fja-odoo 195b71e4f2 [FIX] web_editor: remove unused template
The wysiwyg.widgets.image.existing template was not used and
reintroduced in a refactoring. It is now gone as it should be.

Commit where the template is removed with its only usage:
(in editor.xml as web_editor.dialog.image.existing)
78a30d44cf

Commit where the template is reappearing refactored but not used:
f296992317

Part of #33983
2019-06-19 14:55:30 +00:00
fja-odoo 4ebda2ec2b [FIX] web_editor, web_unsplash: fix nested div
The div that is replaced with the existing.attachments template was not
the right target and kept nesting div into each other.
The parent div of the existing.attachments now has the
o_we_existing_attachments class (the target to be replaced by itself).

Part of #33983
2019-06-19 14:55:30 +00:00
Gorash 82bf73fe30 [FIX] web_editor: avoid dialog error on email edition
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)

closes odoo/odoo#34284

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-20 13:25:37 +00:00
qsm-odoo 6f653ac6a6 [FIX] web_editor: allow fullscreen editor even when inside modal
The new editor of https://github.com/odoo/odoo/pull/29775 came with a
fullscreen option. When using the toggle when the editor is in inside
a modal, the editor stretched only to match the size of the modal
instead of the viewport.

This is because the 'position: fixed' rule which is used to achieve the
fullscreen layout cannot work if a parent of the element has a CSS
transform applied on it. Indeed in that case, that element acts like the
viewport for 'position: fixed' elements.

closes odoo/odoo#34272

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-20 12:52:34 +00:00
Christophe Simonis 039e6bae99 [MERGE] forward port branch 12.0 up to 9c742d0c65 2019-07-05 11:13:53 +02:00
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
Gorash d6b32e6757 [FIX] web_editor: avoid dialog error on email edition
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)

closes odoo/odoo#34188

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-17 14:16:21 +00:00
Christophe Simonis 8fa477cbd9 [FIX] web_editor: use only ES5 compatible code 2019-06-17 14:10:03 +02:00
Romain Derie 873fd422be [FIX] web, web_editor: use isDebug rather than debug on config
Since 72f7139f52, config.debug does not exist anymore, config.isDebug()
should be used.

Two commits merged at the same time were still using config.debug, 87a35d4263
and 88a26235ca

Closes #33961
2019-06-10 20:13:23 +00:00
Thomas Werland 515fb62fc4 [IMP] base_geolocalize,web_editor,doc: create map_view
In order for the map view to work properly:
- I moved scss property to a  file only scoped to website module.
- moved the definiton of "partner_latitude" and "partner_longitude" from
base_geolocalise to base/res.partner

closes odoo/odoo#32487

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-11 07:36:53 +00:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Gorash 5b41b5c563 [FIX] web_editor: escape html tag when copy paste code and text content
closes odoo/odoo#33859

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 08:15:48 +00: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
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02: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
Thanh Dodeur c212cfe899 [REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.

Task #1909865

closes odoo/odoo#32976

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-05 09:12:13 +00:00
Romain Derie 72f7139f52 [IMP] *: use new helper config.isDebug()
Before this commit, both config and session were aliases to odoo.debug.
Now, config.isDebug() should be call, with possibility to pass a parameter to
check if we are in a specific debug mode such as 'tests' or 'assets'.

task-1934445
Coming with https://github.com/odoo/enterprise/pull/4281
Closes https://github.com/odoo/odoo/pull/33213
2019-06-05 05:56:33 +00:00
Sébastien Theys 87a35d4263 [IMP] web, web_editor, *: add media image optimize dialog
* = website, website_blog

The goal is to give the user an opportunity to optimize his images before using
them.

For this we introduce a preview/configuration dialog after every image upload,
where appropriate default values are filled for the quality and resolution,
based on where the image is going to be used. Since this is not going to be
perfect all the time, we still allow the user to configure them, and we display
a preview to ease this process.

Indeed it is important for SEO and for usability in general that the images are
as light as possible in size.

Technically the original image is uploaded and saved first, and then it can be
optimized. This way the upload only happens once, and the preview can be
computed from the already saved image.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 76cf2ae82a [IMP] web_editor, *: improve media dialog attachment upload
* = web_unsplash, website

Remove iframe upload and replace it with a proper RPC. The route is now only
accepting one file at a time, which makes it easier to maintain, and allows to
process the first file as soon as it is ready, instead of having to wait on
everything.

Also fix a bug where a document could not be uploaded because it would try to
parse it as an image.

Remove filter after search result from the JS and add the corresponding
conditions in the domain to avoid processing and returning unnecessary records.

If multiple attachments exist with the same URL, now display them all to avoid
confusion.

Compute all the necessary values in the python model instead of in the JS.

Allow SVG in the widget (the server already accepted them before).

Disable multiple image upload when not in multiImages mode.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 191c556d6b [IMP] web_editor, *: improve file media widget views & selection
* = web_unsplash, website_blog

Rename "image" to "attachment" when appropriate in FileWidget

Improve image selection / highlight code (now based on attachment id)

Improve image grid view:
 - Remove the row mechanism and replace it by a single loop over the images.
 - Take advantage of row wrap for a responsive display.
 - Uniformize the height (prevent tall images from moving down everything).
 - Load a miniature of the images when possible, remove the loading placeholder.
 	This should significantly reduce the download size when opening the dialog,
 	at the cost of CPU usage on the server.
 - Split the existing image view into one view for the loop and one view for the
 	image itself. This way in a following commit we can reuse the image view
 	when adding a new one, instead of having to render everything again.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Andrea Ulliana eacf934230 [IMP] website, web_editor: make minor text modifications
- End of list in image library
- Title add menu item
- Warning message in html/css/js editor
- Wording building block sections

Part of https://github.com/odoo/odoo/pull/30986
task-1939869
2019-06-04 11:27:08 +00: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 60e71302a3 [MERGE] forward port branch saas-12.2 up to 243a4ae5cb 2019-05-13 11:02:27 +02:00
Christophe Simonis 243a4ae5cb [MERGE] forward port branch saas-12.1 up to 330b99f60c 2019-05-10 15:20:01 +02:00
Christophe Simonis cc3a2c1bf3 [MERGE] forward port branch 12.0 up to e11bacfe51 2019-05-09 21:07:44 +02:00
Gorash e244fa23ad [FIX] web_editor: drop an image in the 'mail.compose.message' modal
Issue: Can not drop an image into the modal's editor because the server
request a positional res_id arguments.

closes odoo/odoo#33232

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-05-06 10:32:42 +00:00
Gorash eaeff40236 [FIX] web_editor: drop an image in the editable area
Issue: can't drop a image if the editor is not focused or if the editor is
empty
2019-05-06 10:29:23 +00:00
Christophe Simonis a97037c6d4 [MERGE] forward port branch saas-12.2 up to 78b3b650b0 2019-05-06 12:27:51 +02:00
Christophe Simonis 04acf0cc7c [MERGE] forward port branch saas-12.1 up to 2420492c26 2019-05-03 18:47:49 +02:00
Christophe Simonis 62017de41e [MERGE] forward port branch 12.0 up to d7c0c5c127 2019-05-03 09:16:50 +02: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
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Kishan Gajjarandqsm-odoo 34c4b3ad8a [IMP] website_mass_mailing, *: improve newsletter snippets
* website, mass_mailing, web_editor

This commit adds various improvements in newsletter snippets as follow:

- Improves UI for newsletter popup.

- We only had one popup for all websites. Now, we can have a different
popup for each website.

- The popup was not appearing on mobile/tablet devices. Now, in
mobile/tablet devices, the popup appears automatically after 5secs.

- Added the ability to customize the whole editor popup like any
editable area (background colors, etc).

- User needed to enable popup snippet from the settings. We removed that
setting so now popup snippet will always be available.

- Added new snippet "Newsletter block".

- Display notification after successful subscription the same way for
all newsletter snippets.

Closes https://github.com/odoo/odoo/pull/29353
task-1903256

closes odoo/odoo#29353

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-06-25 09:20:35 +00:00
Christophe Simonis 15b8d353c7 [MERGE] forward port branch 12.0 up to 2830b93a3a 2019-04-17 19:47:37 +02:00
Antoine Guenet 706bf85512 [FIX] web_editor: disable tooltips in keyboard tests and on option off
The link and media tooltips were not taking Summernote's `tooltip`
option into account. That option ensures that tooltips are disabled if
the option is off (which is for instance the case on mobile).
This fix ensures that these tooltips are disabled when the option is
set to `false`.
It also disables tooltips in the keyboard tests. They are not relevant
to the keyboard tests and occasionally caused the DOM to not be properly
cleaned after the tests were run (most likely due to their 2000ms
`setTimeout`).
2019-04-19 10:23:21 +00:00