Commit Graph
2710 Commits
Author SHA1 Message Date
Xavier Morel 79a4d11e24 [FIX] *: bunch of mismarked translation specifiers
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70476

X-original-commit: 92352ed2b5524c97b0aeeba3193c6a8d93ed82a1
Related: odoo/enterprise#18172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-06 12:06:22 +00:00
Jorge Pinna PuissantandSamuel Degueldre f43a0814ae [IMP]*: configuration of ESLint for specific files
This commit will add the needed ESLint configurations on the JS files.
These configurations are added if the JS file uses a different
environment (serviceworker, node, etc) or if it uses a specific global
(google, ace, etc).

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-05-04 13:32:49 +00:00
qsm-odoo 215ae8cadb [FIX] web_editor, *: remove some post new editor dead code
*: website, website_event

Remove some dead code introduced by the new editor merge at [1].

[1]: https://github.com/odoo/odoo/commit/499e8860f194a7eb09a2e224b713a362923d77ac

closes odoo/odoo#70257

X-original-commit: 0a890a353dd89a60fd156f4280d069596b199cc7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-03 12:36:35 +00:00
Samuel DegueldreandTom De Caluwé 2cfb8658bf [FIX] web_editor: fix default shapes not reacting to palette changes
Previously, when toggling on background shapes, they always had the
default colours. In [1] we made it so that when you toggle on a shape on
a section, it would automatically reuse the colors of the surrounding
shapes if any.

Unfortunately, when the "implicit" colors were also the default colors,
they were still marked on the shape, and it got an explicit background
image that would no longer react to changes in the palette.

This was caused by the fact that the call to _getDefaultColors returns
an empty object when the section doesn't already have a shape-container,
this was not a problem before since we were not passing in any colors
when creating the initial shape previously, the the aforementioned
change made it so that we did.

This commit fixes the issue by creating the shape-container before
calling the method that will set the colors on the shape, this way
getDefaultColors works as expected, and the colors are not marked on the
section when they are the default ones, restoring the ability of the
shape colors to adapt to the palette

[1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c

task-2500607

closes odoo/odoo#70054

X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-05-03 09:27:44 +00:00
Sébastien Geelen (sge) ed12ad006a [FIX] web_editor: update toolbar position on scroll
closes odoo/odoo#70221

X-original-commit: 044c047cee83c915b33d21aeddb08d1096ab8060
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-03 07:48:18 +00:00
Sébastien Geelen (sge) 7845a77c61 [FIX] web_editor: update odoo-editor lib to commit 77a1e98
X-original-commit: ea86110cc781b603a6665523cd4359a405f5babd
2021-05-03 07:48:18 +00:00
Antoine Guenet a502bb7223 [FIX] web_editor, note: autofocus the editor on load note form view edit
On creating a new note, the focus was automatically set into the "tags"
field. This was inconvenient and was replaced with an autofocus on the
note itself so we the user can immediately start typing.

closes odoo/odoo#70195

X-original-commit: 8fe89c5ebc138cb517938dbd6d975b8bec4eaf4d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 15:23:36 +00:00
Sébastien Geelen (sge) 86dbb2f4ae [FIX] web_editor: prevent linktool destroy on autocomplete click
closes odoo/odoo#70167

X-original-commit: 3acf90df2f70793554ff13e262cb4ad0e38308bd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 11:31:23 +00:00
Sébastien Geelen (sge) 0c5c4664f6 [FIX] web_editor: fix icon replacement when using toolbar replace button
closes odoo/odoo#70143

X-original-commit: b5ed6558185bb4686d6be6e8c1c4e8c4573c6e14
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 08:06:32 +00:00
Sébastien Geelen (sge) d54959bd9d [FIX] web_editor: fix icon link edition
X-original-commit: 8bb7610e8893cad692cf9ad2f5a89a503a6175ef
2021-04-30 08:06:31 +00:00
Nicolas Lempereur 26a6c99eb0 [FIX] web_editor: email receiver see file icon
Scenario:

- add a file in mass mailing editor => an generic icon (instead of lower
  version where icon depended on mimetype) is added linking the file

- save and send mail => no icon is shown in email received

The system is targeting `a[href*="/web/content/"][data-mimetype]:empty`
to add real image inside instead of using background-image attribute
which is stripped in sanitized.

With this commit, data-mimetype is not removed when image processing
attributes are removed when a file is inserted.

opw-2474053

closes odoo/odoo#70022

X-original-commit: eb3772508ce518ff3f84724eebbe43fd1e040d77
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-28 13:41:14 +00:00
Antoine Guenet dc6737290c [FIX] web_editor: ensure document filename doesn't overflow its cell
The media modal's document tab has cells with icons and filenames. If
the filename was too long, it would overflow its cell, which caused an
ugly design glitch. This ensures an ellipsis on the filename when it is
too long.

closes odoo/odoo#69990

X-original-commit: 8a4f4bf04bd5e5f9cf827273ea27a189a43c2515
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-28 11:19:09 +00:00
Nicolas Bayet 6227dee6ac [IMP] web_editor: update odoo-editor lib to commit 62dbf38
closes odoo/odoo#69471

Related: odoo/enterprise#17788
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-28 07:46:31 +00:00
Nicolas Bayet ef145ea7dc [IMP] web_editor: add commandbar 2021-04-28 07:34:43 +00:00
Nicolas Bayet b2dd959373 [IMP] web_editor: cleanup the toolbar 2021-04-28 07:34:43 +00:00
Sébastien Geelen (sge) c3e08e7a7b [FIX] web_editor: add support for a.btn-link in emails templates
closes odoo/odoo#69922

X-original-commit: 7062ad7495d4ecd7e8a1a89419375c74411c1752
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 12:26:39 +00:00
Antoine Guenet 9569fbef2a [FIX] web_editor: preserve note-editable class on editable in iframe
The "note-editable" class was lost on the editable element when loading
it into an iframe. As a result, some selectors failed, making it so that
some options wouldn't activate when they should.

closes odoo/odoo#69908

X-original-commit: d71b7d87daa5b33f16eb9c6ade29580fb2076313
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 11:28:53 +00:00
Antoine GuenetandNicolas Bayet b79a09c7b2 [FIX] web_editor: ensure proper jquery reference on snippets editor $el
In an iframe, we need to make sure the element is using jquery on its
own window and not on the top window lest jquery behave unexpectedly.
This was apparent with tooltip which was called in snippets.editor with
the "wrong jquery", with the result that tooltip.js had a reference to
the top window/document instead of that of the iframe. Because of that,
it appended its tooltips to the top window instead of the iframe, and
as a result, said tooltips were wrongly positioned.

closes odoo/odoo#69879

X-original-commit: 19be8709efa8f690ccff8d04dd9a17e4ef4d82fd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2021-04-27 07:20:17 +00:00
Antoine Guenet 8d0d5e0d07 [FIX] web_editor: ensure editor in iframe can be scrolled on crop image
The overlay around an image when cropping it is positioned absolutely.
If it has no relative ancestor, it will cover the entire body. This is
what happend in mass_mailing, making it impossible to scroll the page
while cropping. This commit addresses the issue by positioning that
editable relatively so that the overlay never goes beyond its bounds.

closes odoo/odoo#69878

X-original-commit: c4d423640a9f1f9892e9d24dc08531ba0bbf8887
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 07:14:38 +00:00
Antoine Guenet 002cdcab0a [FIX] web_editor: show/hide toolbar on click in editor document
We need to check the selection on click in the editor's document so as
to update the visibility of the toolbar (we want to hide it if the
selection is in a non-editable area). When the editor was in an iframe
however, the wrong document was targeted: we want to check on clicks in
the editor's document, not the top document.

closes odoo/odoo#69775

X-original-commit: b0429c96e30751390991a9471a4c031dfed98d81
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 15:25:33 +00:00
Antoine Guenet 1129e5727d [FIX] web_editor: apply "editor_enable" class to iframe body
Before introducing the new Odoo Editor, the body of an iframe containing
the editor has the class "editor_enable". Now it's applied to the main
document's body. This ensure the class is applied on the iframe's body
like before.
As a consequence, some CSS had to be adapted:
- The position property of the snippets menu which had been overridden,
  probably as an ad-hoc fix for the fact that this class was missing.
- The top padding which is applied to accomodate a top toolbar which was
  removed with the new editor and can now be removed.

closes odoo/odoo#69767

X-original-commit: b7cbb8a8fdbebdb7d33e3286fa9f4ec760ad9fe6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 14:20:36 +00:00
David Monjoie 1551a459cb [FIX] web_editor: update Odoo Editor lib to commit f031cf78
closes odoo/odoo#69761

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 12:30:49 +00:00
Sébastien Geelen (sge) 6c095fbee5 [FIX] web_editor: Fix floating toolbar position when inside a iframe 2021-04-23 12:20:08 +00:00
Antoine Guenet 0c02549186 [FIX] web_editor: properly hide the toolbar when needed in iframe
This fixes a bug in mass mailing, that made the toolbar still visible
while the selection was not in an editable area. It was due to a jquery
selector targetting the top document instead of the iframe's document.

closes odoo/odoo#69707

X-original-commit: 5e3cda847a42561ae709cb792d3e612f8a5e66dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 15:03:05 +00:00
Antoine Guenet db420f14e9 [FIX] web_editor, website: ensure editor toolbar doesn't hide dropdowns
A colorpicker in an option positioned above the toolbar in a snippets
menu would be hidden by the toolbar because of the toolbar's z-index.

That z-index is only needed when the editor is in a modal.

The bug this commit fixes only arises when the toolbar is in a snippets
menu.

This applies the z-index only when there is a snippets menu in the page.
To accomplish that we need the "editor_has_snippets" class that the
website module applied to the body. For the sake of harmony within Odoo,
that class is now applied by snippets.editor so that no matter the
module, if there is a snippets bar, the class is on the body of its
document.

closes odoo/odoo#69680

X-original-commit: b1aa9c6093cea918337d5600ff9b16b7dd80de23
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 12:02:31 +00:00
Antoine Guenet 459d4e27a8 [FIX] web_editor: ensure dropdown menus in toolbar are fully visible
Dropdown menus (eg.: font-size) had their contents cropped if space was
lacking underneath the toolbar. With this the user can scroll down to
see the rest of it if needed.

More info: https://github.com/twbs/bootstrap/issues/23378

closes odoo/odoo#69644

X-original-commit: d360b751acfc1649673739b185b635732cf5b78f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 09:11:23 +00:00
Gorash aa47eda087 [IMP] web: add mode qweb in ace
Add a new parser in the ace for the qweb highlight. This makes it possible
to visualize the qweb tags and the part of code.
Used in the website and in xml fields.

closes odoo/odoo#69609

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-21 12:15:01 +00:00
Antoine Guenet 5af915f74d [FIX] web_editor: properly select the target link on destroy link tools
`setCursor` routinely failed to actually select the target link on
destroy the link tools because the nodes passed to it were not in the
DOM. This fixes that problem, which in turns has the effect of keeping
the editor's toolbar in the sidebar on the website builder after link
insertion.

closes odoo/odoo#69525

X-original-commit: c8fa05813da82fd2b282721f3a86053b7b6661ba
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-20 10:15:42 +00:00
Antoine Guenet f1cbe733b5 [FIX] web_editor: ensure focus is in editable after insert link
Prior to this fix, pressing CTRL+Z right after saving a link dialog
didn't do anything because the dialog prevents the focus from being in
the editable, even though the range is in the link. This waits for the
dialog to be removed from the dom so we can force the focus on the
editable.

X-original-commit: 769a22a579e4622861ca239084d7259820266b23
2021-04-20 10:15:42 +00:00
Antoine Guenet 6db6134f97 [FIX] web_editor: create a history step on insert a link with link tools
Prior to this fix, link tools didn't create a history step when they
were destroyed, meaning that you couldn't undo the creation of the link.
This ensures that the link tools are destroyed whenever a click is done
outside the toolbar, which ends the link edition and commits it to the
DOM. At that moment we can consider the link edition is over, equivalent
to saving the link dialog, and we can create a history step.

X-original-commit: 9b10c5923dadab3a49d474eb236c7c2617fb4be0
2021-04-20 10:15:42 +00:00
Antoine Guenet bcd6f6208b [FIX] web_editor: properly load iframe wysiwyg without defining it twice
Template `wysiwyg.iframeContent`'s `#iframe_target` includes a `script`
element that defines an odoo module (`web_editor.wysiwyg.iniframe`).
`wysiwyg_iframe.js` resets the html of that target so that the node
prototypes are defined relative to the top window rather than the iframe
window. Resetting that html had as a side effect that the script was run
a second time while that is unnecessary given that the module has
already been defined. This resulted in an error, which is here fixed by
removing the `script` element from the html when resetting it.

closes odoo/odoo#69492

X-original-commit: 3d4e0f15dd9a0009a7d0fc19fc29a5df9a6f92e8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 14:22:49 +00:00
Sébastien Geelen (sge) d5ec63cd48 [FIX] web_editor: fix traceback for some CTRL+A cases in mass_mailing
closes odoo/odoo#69486

X-original-commit: 22926d0bfca472daad8cebddbc19e6bb3e846904
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 13:25:06 +00:00
Sébastien Geelen (sge) f3043e94e9 [FIX] web_editor : correctly update toolbar inside iframe
closes odoo/odoo#69479

X-original-commit: cdd625b9c6ea6eb5f8a7c35175e85cf701869648
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 12:29:41 +00:00
Antoine Guenet 61fc91243c [FIX] web_editor: build editor up to commit fa480dd
closes odoo/odoo#69422

X-original-commit: 6ba1571547a9b7d62438fed15d061485d1696026
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-16 16:54:31 +00:00
Antoine Guenet 6b0bed04df [IMP] web_editor: remove useless resizer on mobile
X-original-commit: 808207b0b7b1ebc22c65d83034bd75f761c0efed
2021-04-16 16:54:29 +00:00
Antoine Guenet 6b01724c84 [IMP] web_editor, note: make notes fill their container
X-original-commit: 05d6f0cfdc35842c5847db70475da5e7c982ba06
2021-04-16 16:54:28 +00:00
Romain Derie 86cf231bf1 [FIX] web_editor, website: restore link popover behaviors
This commit fixes multiple bugs related to the new link popover edition [1].
Those bugs mostly comes from new editor integration [2] conflicts, as those
where merged almost at the same time and needed a quick fix of rebase
conflicts.

- The navbar & footer link would not load the popover link edition anymore,
  as it was only targetting `#wrap`.
- Double click on links was re-introduced but it was supposed to be gone.
- Tooltip from Edit and Unlink inside the popover remained open after popover
  was closed.
- Some leftover code that were not related to popover but kept during the
  rebase.

[1] Commit 8fcf930a6b
[2] Commit 740168ce8d

closes odoo/odoo#69389

X-original-commit: e13966cc8e04111a9e18a344132546c6baa79fea
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-04-16 11:28:52 +00:00
Antoine Guenet 65800bcfa5 [FIX] web_editor, mass_mailing: restore missing html edition feature
closes odoo/odoo#69324

X-original-commit: 8e4d0c43eac15718df45b32738d7eb46be426652
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-15 14:00:39 +00:00
Antoine Guenet 46ff93fdab [FIX] website, web_editor: properly init and save new menu entries
X-original-commit: 31063c117a46cb77efe9e4d2ad3d8bd19940dc2f
2021-04-14 08:28:05 +00:00
Nicolas Bayet da435ceff1 [FIX] web_editor: update toolbar
closes odoo/odoo#69194

X-original-commit: 82072abe8f22a2326c32905c7d8b827aebadb4bb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-13 15:46:28 +00:00
Nicolas Bayet b10b77b7c2 [FIX] web_editor: update call of applyColor
X-original-commit: f1c34a15fb1bf78ea745ca915065ccdb75ae0a8e
2021-04-13 15:46:28 +00:00
Nicolas Bayet 4e34a17575 [FIX] web_editor: update odoo-editor lib to commit 2d94352
X-original-commit: 201ef89c07adcbed0dd16b7553f804b793ef8224
2021-04-13 15:46:27 +00:00
Antoine Guenet 386875cf3d [FIX] web_editor: prevent traceback on select image
Trying to select the contents of a content-less element should select
the element itself instead.

closes odoo/odoo#69173

X-original-commit: 6905eaad2ccaa782e3dce99b9581ed0194c37db9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-13 12:30:39 +00:00
Antoine Guenet 500ebb0687 [FIX] web_editor: ensure editor's floating toolbar is visible in modals
Bootstrap sets a z-index of 1050 for modals while the editor's floating
toolbar has no set z-index and is therefore invisible in modals. This
ensures the visibility of the toolbar in bootstrap modals.

closes odoo/odoo#69160

X-original-commit: 9cd4eb6db072fd55d47240260e63fd5923b3bddb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-13 10:08:32 +00:00
Antoine Guenet 4a1d776243 [REF] web_editor: prevent duplicate code in LinkDialog and LinkTools
LinkTools were recently introduced to provide a new UI from link editing
within a sidebar where there is one. It was implemented separately from
the existing LinkDialog despite them having a lot of code in common. In
order to prevent future discrepancies between them, this commit
introduces the Link widget which contains the common logic for link
editing, to be extended by LinkTools and LinkDialog (via an intermediary
widget).

closes odoo/odoo#69137

X-original-commit: 5415ea46f8d3ee4732111a21b0cd9fa8bdb9526e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-12 16:11:14 +00:00
Nicolas LempereurandKamen Zhekov 38464f5aaf [FIX] web_editor: have transcoder apply text-decoration
The transcoder (transforming CSS rules into inline CSS for mail clients)
was not working for text-decoration property because it would transform
text-decoration values in:

{'text-decoration-thickness': 'normal', 'text-decoration': none}

And the regex that ensures we don't add duplicates check if there is:

"(^|;)\s*text-decoration"

so if there is text-decoration-thickness, text-decoration is not added.

The regexp could be changed to:

"(^|;)\s*text-decoration[^\w-]"

but we already have special case for other text-decoration-* properties.

With this change we should get text-decoration applied in:

- edit mode (was already the case)
- readonly mode (new)
- mail client (only if mail client does not override it)

As a side note: text-decoration-thickness seems to be rather new[^1] so
at one point in time there was probably no issue.

[^1]: https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness

opw-2496490

closes odoo/odoo#69078

X-original-commit: f4f1b890e15e98d9a7e72586faf73327d3f7b716
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Kamen Zhekov <kzh@odoo.com>
2021-04-09 18:24:21 +00:00
Sébastien Geelen (sge) ef83c6af8f [FIX] web_editor: re-implement focus method
Focus is sometimes called on the Wysiwyg class in Note.
When the user use TAB to select the next field.

Implementation was missing.

closes odoo/odoo#69033

X-original-commit: 720c1f38a17ef54cf30e0a52bab5bceed70c2144
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-09 10:48:31 +00:00
Sébastien Geelen (sge) d7c4362319 [FIX] web_editor: update odoo-editor lib to commit 68108b2a
X-original-commit: d3c17baf260d962eb620c77e03afccea8c16c1d1
2021-04-09 10:48:30 +00:00
Sébastien Geelen (sge) 92d0713478 [IMP] web_editor, mass_mailing: activate undo/redo button in mail edition
closes odoo/odoo#68912

X-original-commit: 2b12674fcfdebf362e5bd806bc8374d82c30de82
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-07 15:44:43 +00:00
Julien Mougenot 3e3dce0eb8 [REF] *: rename assets 'glob' to 'path'
Rationale:
The majority of cases where an ir.asset is manually declared
outside of manifest files is to specifically add a single asset file.
This means developers are specifying a single asset *path*, and not a
glob expression. In this context, it seems better to name the filepath
field `path`, and document that it can be specified with a glob
expression when (seldom) needed, rather than making the exception appear
to be the norm - possibly puzzling many developers (What's a glob and
why do I need one?)

The doc is updated as well, and some spell-checking and wording
improvements were done too.

This required some adaptations to the existing `ir.asset` declarations:
- odoo/enterprise#17465
- odoo/design-themes#459

closes odoo/odoo#68695

Related: odoo/upgrade#2348
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-04-07 20:39:10 +00:00