A lot of tests in different QUnit modules need this delay to be
patched to 0. Some of them (e.g. the 'ActionManager > Misc' module)
didn't patch it correctly. It worked before because a patch was
done in a previous test, and wasn't unpatch. The previous commit
ensures the patch is removed, so now we have at least 2 tests of
the above mentionned module that fail. This commit ensures that
the delay is patched in every tests, and allows to specify a
custom delay if necessary.
When clicking on link in html fields, we do not wish to start quick
edition. With this change this is excluded.
closes#68023closesodoo/odoo#68212
X-original-commit: ecbdddbf0cff0964b44e7f0571d372ccbd051a72
Related: odoo/enterprise#17235
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In #67893 the image icon was removed, but it contradicts the interface
and made a feature that was working for employee less available.
Since saas-12.3, we always use the full media dialog when showing the
editor on the forum so we could not add an image with the image icon if
were not an employee.
Before saas-12.3, the original summernote image dialog was shown for
everyone but website editor that saw the full media dialog (beecause we
are using the same editor to do both things).
With this change, we always have the original dialog in the forum
message editor thanks to a new option "disableFullMediaDialog".
opw-2470720
closesodoo/odoo#68166
X-original-commit: c026c360fb77ce43f47f7645f48e37bced988b85
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
*: web_editor
All theme specific color palettes have been moved into website.
It allows to access them without having to install theme modules and
this is a preparation for our website configuration screen task.
Lists of palettes have been replaced by maps with palette names as keys.
Those names are composed of the palette's original theme name ('generic'
or 'base' for palettes not specific to a theme) and of an index
(ex: 'anelusia-2'), for compatibility.
To keep compatibility with previous version we also convert old color
palettes number to color palette name, specifically for each theme.
A side effect of this change is that we got rid of all gray palettes
which existed in some themes. Those were not fitting the new possibility
of gray customization in the third panel and were not always really a
good customization of the default grays (they still were there mainly
for historical purposes). Unfortunately, this may have some side effect
for old websites which used those grays but the new gray palettes (left
to the default one) should most of the time come as an improvement of
the old ones, and they are now customizable by the user. In the future,
we may associate a perfectly-chosen default gray palette, fitting the
customization system, for each color palette.
PR: https://github.com/odoo/odoo/pull/67488
task-2451965
closesodoo/odoo#67488
Related: odoo/design-themes#455
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit:
- Edit mode, open image dialog
- Upload an image to the media dialog
- Reclick on Upload but don't select an image, close the browser image
selector
- This will trigger the input change event, as the input was emptied
This is needed since in later commit, `_addData()` will do some code outside
of the `files` loop, which is useless if there is no files selected.
In thise case, the issue would be that it would open an empty toastr.
task-2345082
Coming from #65828Closes#68326closesodoo/odoo#68340
X-original-commit: 94c45412714c1263788b2567ce3c9581453b2cd4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, when selecting certain options, especially ones which had
slow updateUI methods, the selected value was sometimes reset to its
previous value. This was caused by a race condition in which, when a
snippet option updated its value, it would wait for options on the
parent snippet editors to update all of their options' UI, but it
incorrectly only waited for *one* of the snippet editors to finish
instead of waiting for all of them.
This commit fixes that by stopping the event propagation and triggering
a new event that will let the direct parent know when all parent editors
are done updating their options' UI before signalling that the UI update
is done.
task-2487578
closesodoo/odoo#68341
X-original-commit: 7623a0c771495cd41bf40af37c0d2b6e4beb7cdc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
This commit introduces a many2many as a standalone, reusable
UserValueWidget. This widget is built on top of the ListUserValueWidget
which was until now only used in website form that had to be updated to
allow more generic use of the widget.
Part of https://github.com/odoo/odoo/pull/67832
task-2274732
*: web_editor
The purpose of this commit is to control the hue and the saturation of
the gray palette.
task-2362091
closesodoo/odoo#66428
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Add an event listener triggered on current value change of input range.
task-2362091
closesodoo/odoo#66812
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
Adding the option to show/hide on mobile at snippet level + review the
UI (now a top action button).
task-2431659
closesodoo/odoo#65013
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The current rules would allow through a selector of the form
:not(sel1, sel2)
then because the matcher thing just splits on `,` it would store the
incorrect sections
:not sel1(
and
sel2)
as separate selectors in the rules cache, raising an exception when
matching against elements.
Move all the rules to a single regex, and add a rule to exclude any
situation where a comma or an open parenthesis is inside of an open
parenthesis pair: we can't just check if there's a closing parenthesis
with no intermediate `,`, because the selector could be
:not(:nth-child(3), sel2)
in which case the selector would "pass" as the regex would match the
nth-child's closing paren to the not's opening. This means some
selectors *could* be unnecessarily blacklisted, but currently we don't
have any such nested pseudo-classes so...
If we want to resolve this, we need to actually parse the
selector (using something like Sizzle I guess) in order to properly
split the selector-list and take a real look at the selector's
structure. Maybe one day.
closesodoo/odoo#68093
X-original-commit: d50c3b07f1c0644ac8e412f099ddd7b139671060
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The code added in [1] to update style for multi image selection
is not compatible with .fa icons and causes a strange behaviour when
trying to select one.
The goal of this commit is to fix style for selected icons on media
dialog.
Also fixes the fact the icons were not centered before.
[1]: https://github.com/odoo/odoo/commit/bb65b742e7eec000248b7df0f048dda61ac3ff5aclosesodoo/odoo#67846
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
*: website
When declaring a SnippetOption, it is now possible to specify if the
display of the handles overlay should be visible on the snippet element.
By default, it is set to false, and if the selected snippet element does
not have any option that require the handles to be displayed, we will
display them on the first parent element that needs the handles to be
displayed.
In the context of an image, the handles will be displayed on the parent
column, as the image does not have an option that require the handles.
Part of https://github.com/odoo/odoo/pull/66550
task-2431684
closesodoo/odoo#66550
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
From the editor, when clicking on an image there is a new refresh icon
next to the delete icon that will open the media dialog to allow for its
replacement.
Part of https://github.com/odoo/odoo/pull/66550
task-2431684
*: web_editor
The goal of this commit is to tweak the code of <we-range> widget
to be able to select a css using class values.
This way, the image spacing selection can be easily replaced by
a slider of 4 levels [0 -> none, 1 -> small, 2 -> medium, 3 -> big].
Part of https://github.com/odoo/odoo/pull/66544
task-2326573
*: website
The goal of this commit is to improve multi image selection
(Image Wall, Gallery...) using the same layout as in selected themes
for selected images.
Part of https://github.com/odoo/odoo/pull/66544
task-2326573
This was caused by trying to not show dynamic-svgs that had already been
downloaded when the option to not allow the media-library was activated
(eg in the website logo, we do not want to allow dynamic SVGs)
Unfortunately the domain was doing a string comparison to make sure the
url wasn't like the one from dynamic SVGs but implicitly required that
the url field be not null. This commit fixes that by explicitly allowing
images with a null url field.
task-2466819
part of odoo/odoo#66732closesodoo/odoo#67411
X-original-commit: 0784e14dd39817720e6fc70c2b41ea3bbad5843a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, when quality options were not available, the option would
simply not be displayed. User feedback suggests that this is confusing,
as for example, in the case of modifying the image in a t-field, quality
options would not be available when starting the editor, but would
become available when picking the image again in the media-dialog.
Some leftover code allowed to display a warning about why the quality
options were not available in the case where the image is not local to
the database. This warning has been adapted to display a more
informative message about why quality options are not available, as well
as suggest a solution:
- External image => download the image and upload it in odoo
- t-field => "You need to choose this image again in the media-dialog or
reupload it to have access to quality options"
- Images that are in an unsupported format (anything other than PNG or
JPEG) => short explanation that quality options are only available on
PNG and JPEG images.
task-2466819
part of odoo/odoo#66732
X-original-commit: 84417a174bc2bb76730cc89783d3426a3a3b07d9
Styles for the hex and rgba inputs from the color picker were modified
on directly from the web module, which means that for a specification
concerning only the frontend colorpicker, the backend colorpicker was
also changed.
This commit reverts the changes that were made and only applies the new
style for the website editor.
Related to https://github.com/odoo/odoo/pull/65249closesodoo/odoo#67396
X-original-commit: 9529e29615699942aac89099cd37144e052b9004
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When a block is removed, the parent will be activated.
If the parent element is empty and removable:
1) It will be removed too.
2) In '_activateSnippet' method, we look for the right element to
be selected using the block's parent (removed from the DOM...).
The goal of this commit is to fix this behaviour by computing the
selected element before parent removal.
task-2431506
closesodoo/odoo#67354
X-original-commit: 1d483ab5e2f9bba0fd86c6fe4595a9959b2f125d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When we double click a form submit anchor, and depending on the selected
element before click, the selection range ("document.getSelection()") can
start from a parent of the targeted node. This will send a wrong range
to be used in LinkDialog widget.
The goal of this commit is to prevent this behaviour by adjusting the range
if it starts from anchor parent.
Note: the bug only occurred in Firefox.
Part of https://github.com/odoo/odoo/pull/62206
task-2381305
closesodoo/odoo#62206closesodoo/odoo#67171closesodoo/odoo#67176
X-original-commit: 9a16c313f131ed2e1017566a5f1bed134e22cc10
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor, website_mass_mailing
When we double click a link/button, a link dialog appears
to update the target properties, and since the current link dialog
can only handle anchor targets, using it on buttons leads to some
inconsistencies :
- visible href options for button & url required to save changes.
- missing preview when button style changed.
...
The goal of this commit is to add a fix (with minimum of code) on
summernote linkdialog to handle button elements using the same logic as
anchor nodes.
Also, update website form test tour to test those new changes.
Part of https://github.com/odoo/odoo/pull/62206
task-2381305
X-original-commit: 19fbbdc0327482b5d70bdbcf17c2a5a950327d63
CONTEXT: Within a container, delete a block which has a sibling.
The actual behaviour is to select the container after deletion.
The goal of this commit is to select the previous sibling (if exists),
or next one. Otherwise the parent element will be selected (default behaviour).
task-2431506
closesodoo/odoo#64875
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* When clicking on a button that is a preview for a "mass mailing",
always open it in a new window for the user that is editing the form, so
that changes are not discarded (when leaving the page).
- The option "Open in a new window" remains effective for the recipients of the mail.
* Rename Mailing Campaign to Campaign : this is just a mailing campaign,
they are used everywhere in the marketing scope now. And it can be part of
a multi-channel campaign.
* Show/hide mailings count depending on settings :
- Mailing Campaign must be activated in the email marketing settings in
order to display the Mailings count in the utm.campaign kanban view
* When there is no matching recipient for a mailing campaign,
properly display 0 / 0 instead of 0 / 1 to better indicate that it is
not expected that anyone will receive an email.
Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
This commit aims to force to open in a new tab out-of-domain hyper-links
in backend html fields.
Previously:
When a user adds a link in an html backend field, the user is free to
choose if the link will open in a new tab or not with a check box.
After this commit:
When a user adds a link in an html backend field, this link opens a new
window if those two conditions are met:
- The url doesn't begin with the current location origin;
- The url doesn't begin with a "/", i.e. an internal link
that has been stripped.
The user doesn't have the check box option.
Remark:
This doesn't affect previously added links BUT if a previously added
link is opened in a LinkDialog, it will be re-rendered following the
conditions hereabove.
Part of https://github.com/odoo/odoo/pull/64622
task-2377544
closesodoo/odoo#64622
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* = web_editor
Add support for default values on website form
Compatible fields are: textarea, text, number, date, datetime, unique
checkox, multiple checkboxes, radio buttons, select.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
* = website
Add we-datepicker
Allow empty date/datetime inputs
The countdown was the only snippet using this so if no date it will
default to timestamp 0 and display a resolved countdown.
Before it was the moment().now() datetime which is the same result:
0 time remaining.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
Empty attributes were not removed from the element.
This is an issue for attributes like checked/selected on input/select.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
If a field is sanitized, a6e2b48 would hide the video button because
the video does not show in backend. It is better for the consistency but
if the field appear in frontend, the video would still show so we
prevent something that worked (but is very not user friendly when
editing in backend).
This changeset go back to the previous behavior (keeping the code
simplification), at one point there should be a fix so at least when
editing we see the video (currently we see an empty div in given
conditions).
opw-2463746
closesodoo/odoo#66920
X-original-commit: 73f5781
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Scenario:
- set new background image
- set parallax
- save
=> on next edition, the editor doesn't work on background anymore
Why:
- backgroundOptimize copy attributes of the original image to the real
target element on save
- parallax change the real target element to a new child
=> so if the original element was an editor (with data-oe-model, ...)
attributes, with the combination of the two options we will save
these editing attribute on the child element which is wrong (the
editing attributes are added dynamically and should not be saved).
With this changeset, we don't copy the editing attributes in
backgroundOptimize when we copy the original target image.
opw-2427560
opw-2429340
closesodoo/odoo#66691
X-original-commit: 6e47db5efcd78157f054144315a4812bbb6fbbd9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The goal of this commit is to enable the click on Style tab
in "Edit mode".
The click on this tab with no block selected will display a
message to inform the user that he has to select a block
before editing.
task-2443297
closesodoo/odoo#65573
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Scenario:
- go to /slides and start editing the page
- change the position of background banner
- save
=> traceback
Why:
The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).
opw-2427560
closesodoo/odoo#66643
X-original-commit: 96c22e816981d72c185520750167c514c6bded5b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Context:
1) Edit mode
2) Click on anchor edition button of website form submit button
3) Traceback occurs
The "focus" triggered on $editable element in editor's 'getLinkInfo()'
discards user's text selection on submit button, as a result,
'range.create()' method returns null since no selection is found.
Note: the bug only occurred in Chrome.
Note 2: [1] apparently tried to solve the same issue but the fix was not
solving it correctly, at least not in all cases.
[1]: https://github.com/odoo/odoo/commit/da14e4449e5e318eb72e1b9f268fb797adb0c6a6
opw-2443441
closesodoo/odoo#66574
X-original-commit: adf3d039acbac60b7ea7e6ab0ea8fdd9f940c3b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Scenario:
- start editing background position
- press TAB key
- press CTRL + Z
=> traceback
Why:
Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.
reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417
opw-2423445
closesodoo/odoo#66564
X-original-commit: 2c0aa825ee54ed674ff9f43722031df8e2f35ca6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Scenario:
- start cropping of an image
- press TAB key
- do CTRL + Z
=> now the image cropping tool are inside the page and there is no way
to remove them.
Why:
The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.
opw-2394877
opw-2423445
closesodoo/odoo#66499
X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Enter keypress browser event were removed in 3c372d1da8.
It was reintroduced in text fields with d2f024d254 and in source mode
of html field with b10ca1f6094b.
When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.
With the "Enter" prevention, SHIFT+ENTER did not work.
opw-2463746
closesodoo/odoo#66455
X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When we edit a view with ace in eg. studio, if it works the saved button
would never be enabled again because of missing callback.
Match the behavior of dom.addButtonLoadingEffect other usage (80592abd).
opw-2457046
closesodoo/odoo#66301
X-original-commit: 5324f7a6aa757ff6a728258ea1877ded4a6f86cd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the preview of the dragged snippet didn't work
when moving a dragged snippet from a drop zone to an other drop zone
when there was no space between those drop zones.
It is because, in this case, the over event of the second drop zone is
triggered before the out event of the first drop zone.
task-2312878
closesodoo/odoo#66267
X-original-commit: 66b468626e046a13a463cff3a2285801016f3ed7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit when toggling shapes on a snippet background, the
shape color palette was always set to the default one.
After this commit when toggling shapes on a snippet background, the
shape color palette is computed by combining the default palette with
the palette of the previous shapes in the page.
task-2431445
https://github.com/odoo/odoo/pull/64515closesodoo/odoo#64515
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit when toggling shapes on a snippet background, the
shape selection dropdown was shown as closed.
After this commit when toggling shapes on a snippet background, the
shape selection dropdown is automatically opened.
We have to use a click() on the toggler instead of an open() on the
dropdown to make the page containing the selected shape appear when
opening.
task-2431445
https://github.com/odoo/odoo/pull/64515
Color palette are only visible once they are opened. However, we
instantiate them a lot to build the "options" editor panel which caused
the editor to appear buggy for some users... even if they would never
open a colorpalette. This fixes that issue. The fix is not entirely
stable but was made as stable as possible... better implementation will
be done in master.
task-2439295
https://github.com/odoo/odoo/pull/65223closesodoo/odoo#66217
X-original-commit: 9aeba7dec95b397ef894f5a181920dff269d6ad4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Before this commit the palette was rendered each time it was opened.
After this commit if the palette has already been rendered only the
selected color is being updated in the palette (and its colorpicker).
task-2439295
https://github.com/odoo/odoo/pull/65223
X-original-commit: 7f19f63b18bc7d17a393b3535492c7f90595ca39
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Before this commit the loader did not always get displayed when
switching to the options tab.
After this commit the loader always gets displayed ASAP when switching
to the options tab until the tab is ready and displayed.
task-2439295
https://github.com/odoo/odoo/pull/65223
X-original-commit: f2fa17540e130b5cf3f70570a3a97495cfbb7499
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Previously, edition of many2ones in the front-end was done through a
snippet option. While this works fine for raw many2ones in the page, it
is desirable that other snippet options can leverage a many2one as a
part of a more complete or comprehensive option. This commit introduces
a many2one userValueWidget that will be able to be reused by snippet
options, and adapts the existing many2one snippet option to use it
instead.
The interface has also been reworked so as to lean on the existing
we-select UserValueWidget for the sake of interface consistency.
Thanks to fja-odoo for first iteration.
task-2190603
closesodoo/odoo#63835
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>