Commit Graph
6742 Commits
Author SHA1 Message Date
Brieuc-brd 48aa2445e8 [IMP] website: update the bewise-1 color palette
This commit updates the bewise-1 color palette. It replaces the
o-color-2 by the extra color of o_cc4 and improves the compatibility
with the others palettes when we switch between them.

task-2573302

closes odoo/odoo#75159

Related: odoo/design-themes#477
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-04 06:24:01 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Raphael Collet 765ec7837c [REF] core: add methods flush() and clear() on cursor
This deprecates the ugly and inconvenient functions flush_env(),
clear_env(), and avoids explicit calls to precommit.run().

Part-of: odoo/odoo#75598
2021-09-03 15:45:46 +00:00
Romain DerieandTom De Caluwé 78bc86cbec [IMP] website, *: migrate Universal Analytics to Google Analytics 4
*: website_sale, website_sale_delivery

The old analytics snippet (isogram) is replaced by the newer gtags
snippet. Virtual page views and ecommerce transactions are now tracked
using gtags. The e-commerce data format is updated to correspond with
the new GA4 format.

task-2500769

closes odoo/odoo#72233

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-09-03 15:45:08 +00:00
qsm-odoo 6799161c52 [FIX] web_editor, website: restore backend HTML fields in no-website DBs
The SCSS compilation failed if website was not installed since [1] as
a mixin was used in web_editor while defined in website...

[1]: https://github.com/odoo/odoo/commit/5ffce116a6f8d4775cffe4daef09674db6c159d0

closes odoo/odoo#75938

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-03 14:30:55 +00:00
Benjamin Vray 551e4372a5 [FIX] website: fix height and top position of modals
Since we added a z-index: 0, on the wrapwrap, the modals are under the
main navbar and therefore partly hidden by the height of this navbar.

After this commit, the top position of a modal is the height of the
main menu navbar but only if that navbar is displayed. The height of
the modals is also reduced with the height of the navigation bar to
avoid overflowing at the bottom.

Some of what this commit did had already been merged in saas-14.2
(in this PR: #69360) but we realized that we also needed this fix in
v14.

task-2501400

closes odoo/odoo#75928

X-original-commit: d8e9569ef04ad86f0558b3e674bc8b74718c9c70
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-03 14:30:47 +00:00
qsm-odoo 6854ff8026 [IMP] website: add no-hamburger-in-mobile option
At the same time, review the whole "hamburger type" option to be more
clear for the user. Unfortunately, the whole "no-hamburger-in-mobile"
option is kinda going against the way our editor works right now so this
commit implements it with well-placed hacks... to improve somehow at
some point.

Part of https://github.com/odoo/odoo/pull/68149
task-2368576

closes odoo/odoo#68149

Related: odoo/design-themes#11
Related: odoo/upgrade#2294
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-03 14:29:52 +00:00
qsm-odoo ff26771e9c [IMP] website: rearrange the logo option in header
Part of https://github.com/odoo/odoo/pull/68149
task-2368576

Part-of: odoo/odoo#68149
2021-09-03 14:29:51 +00:00
Oussama MESSAOUDIandqsm-odoo 7e8ba9bc2f [IMP] website, *: review the header templates + add CTA as an option
*: portal, website_sale, website_sale_wishlist

Part of https://github.com/odoo/odoo/pull/68149
task-2368576

Part-of: odoo/odoo#68149
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-03 14:29:51 +00:00
qsm-odoo 2a8a5dc7a9 [IMP] web_editor, *: allow editor widgets to depend on ancestor ones
*: website

The visibility dependencies are now searched in the current
SnippetEditor instance but also in all its ancestors.

Part of https://github.com/odoo/odoo/pull/68149
task-2368576

Part-of: odoo/odoo#68149
2021-09-03 14:29:51 +00:00
qsm-odoo 1d49b5112b [FIX] website: move configurator templates in dedicated file
Unfortunatly needed while another "complex" bug fix is done: xpath
validation during module install seems to be done after each view
creation. With the upcoming header template refactoring, by mischance,
the configurator template validation will not work at install anymore
while it is perfectly valid (and the only way to define it) after
install:

Before future refactoring:

1) install view which adds nav inside X
2) install configurator view, primary view which removes the first nav
   inside X
3) install view which adds another nav inside X... the nav the
   configurator wants to remove !

-> Validation of (2) works thanks to (1) during install while (2) wants
   to remove something that is not installed yet. But (2) is valid it
   should simply not have been evaluated yet.

After future refactoring:

We remove step (1) -> (2) has to be done after (3) to pass validation
at install while the system is not bug fixed.

Part of https://github.com/odoo/odoo/pull/68149
task-2368576

Part-of: odoo/odoo#68149
2021-09-03 14:29:50 +00:00
Benoit Socias b88bb72beb [IMP] website: search inside translated pages
Before this commit the search on pages was only done in the main
language.

After this commit the search on pages is based on the translated "arch"
field.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benoit Socias 9f9c4bb7e4 [IMP] website(_*): replace search callbacks by a mixin
Before this commit the `_search_get_detail` result contained callback
functions to handle special behavior during fetching and rendering.

After this commit a `website.searchable.mixin` is introduced that must
be inherited by models that participate in website-based searches.
Custom behavior previously achieved with callbacks is now achieved by
overloading methods of this mixin.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benoit Socias c6ba756e4b [IMP] core, website: use fuzzy matching in web-based search
Before this commit searched terms were the ones entered by the end-user.

After this commit if the searched term is not found then the search is
performed on a resembling term.
The similarity is obtained from a Levenshtein distance combined with
ratios of common and different letters.
By default the dictionary against which the search term is matched is
based on the content of the search fields containing a word that starts
with the first letter of the search term.
If the `pg_trgm` Postgresql extension is installed the dictionary is
built from matches using the `<%%` operator (similar to the
`word_similarity` function).
Several approaches were benchmarked during development, those results
are available through the task record.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: website_blog, website_event, website_forum, website_sale,
website_slides)

Before this commit the search bar was specific to products.

After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".

In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.

The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benjamin Vray 5ffce116a6 [IMP] website_payment, *: new snippet make a donation
*=  website, website_sale, web_editor

This commit add a new snippet donation for the website builder.

PR-63133

task-2398403

Part-of: odoo/odoo#63133
2021-09-03 02:03:14 +00:00
Benjamin Vray ec005bae0e [IMP] website, tools: allow to translate hidden inputs
As the descriptions of the donation snippet will be in hidden inputs,
we added the possibility to translate these inputs in translate mode.

PR-63133

task-2398403

Part-of: odoo/odoo#63133
2021-09-03 02:03:14 +00:00
Guillaume (gdi) 151d570933 [FIX] website_form: prevent input ids from being duplicated
When cloning a website_form field, we rerender the cloned field to
reassign its elements ids and for attributes with a unique ID instead of
the old ones.

Rerendering the list also removes an issue with Selection fields that
were not visible after a clone and a save, as it was usually done after
a _rerenderXML, not executed after a clone.

Also, _renderField docstring was wrong, and its return values
terminology have been replaced with correct one.

task-2485093

X-original-commit: 92bacc8907fa9577805b28a11894e7a006b2a5bf
Part-of: odoo/odoo#75908
2021-09-03 00:49:13 +00:00
Sébastien Geelen (sge) fc67a3370a [FIX] website: ensure cover changes are saved
Changes on cover attributes (bg-color, size) were not saved properly
when no other option where changed on the object.

task-2547729

closes odoo/odoo#75890

X-original-commit: 6d00c5ac0346beb57eef2192fe21a45a1158d87e
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-09-02 15:36:54 +00:00
Younn Olivier fa1c05e7bb [IMP] website: disable assets for unused snippets
Based on their path, we retrieve snippets assets, assuming that it will
be in the form : /snippets/{snippet_id}/{version}.{scss|js}

Then we check the template definition uses that version, or if any views
or html fields contains a snippet with such version exist.
If not, the asset is deactivated.

For that, we are looking for the data-snippet attribute in snippets
already dropped. For the template definition, we look at the first class
definition if a data version attribute is also defined.

task-2212216

closes odoo/odoo#73005

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-09-02 14:14:56 +00:00
Younn Olivier 7a96557b83 [FIX] website: fix animate options for dropdowns
The WebsiteAnimate option was triggering a resize on the window in its
start method, which would lead to a scroll on the wrapwrap and closing
the megamenu dropdown if it was open. Besides that, animations were not
working when selected on a section in a dropdown menu.

Now, an open dropdown that has animated content is considered as the
scrolling element so that its animations are rendered correctly and it
is not closed because of a scroll elsewhere.

The "Launch animation at first time/always" option is hidden for
dropdowns as bootstrap will launch it anytime a dropdown is open.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

closes odoo/odoo#71143

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-02 14:14:52 +00:00
Younn Olivier 56b70e16db [IMP] website: prevent dropping snippets in mega menus
This prevents dropping main snippets in the mega menus, but it is still
possible to move the elements inside it or drop inline snippets.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
2021-09-02 14:14:52 +00:00
Younn Olivier 733003e8e5 [IMP] website, web_editor: do not show mega menu parent options
A new class has been added for snippets that should not display their
parents options: o_no_parent_editor.

With that class the editors for the parents of this snippet won't be
created.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
2021-09-02 14:14:51 +00:00
Younn Olivier 3d9e7c9a91 [IMP] website, *: toggle mega menu options when toggling the dropdown
*: web_editor

As the mega menu templates are now displayed as an option of the mega
menu snippet, opening the mega menu dropdown in edit mode will display
the options.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
2021-09-02 14:14:51 +00:00
Younn Olivier a57cda43c3 [IMP] website, *: use widgets to display mega menu templates
*: web_editor

The masonry templates selection SnippetOption has been abstracted so
that mega menus content can also be replaced with template content.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
2021-09-02 14:14:50 +00:00
63a3ba4a42 [IMP] website: add mega menu snippets
New mega menus :
- s_mega_menu_big_icons_subtitles
- s_mega_menu_cards
- s_mega_menu_images_subtitles
- s_mega_menu_little_icons
- s_mega_menu_menus_logos
- s_mega_menu_odoo_menu
- s_mega_menu_thumbnails

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-02 14:14:50 +00:00
Brieuc-brd e7d779add6 [FIX] website: fix alignment for narrow size of mega menu
This fixes a bug about alignment, which shifted the mega menu with the
narrow size by 50%. This bug was triggered in multiple headers:
- sidebar
- hamburger
- magazine

task-2502208

closes odoo/odoo#75877

X-original-commit: 1f54c7f5cb458b437a54ea0cde9c0df388c1f47d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-02 05:46:00 +00:00
Sébastien Mottet (oms)andqsm-odoo 97b103dcd2 [FIX] website, *: fix conversion of specific svgs on Firefox
*: website_slides

A function allowing to convert a SVG to a PNG has been added as an
utility function in website.utils and is used for the upload of document
in website_slides. This function add support for a specific case which
was not supported by the previous conversion function used for the
document upload in website_slides: SVG without width and height
attributes on Firefox.

Related to task-2602521

closes odoo/odoo#75866

X-original-commit: b5ad8d66e311afcc30dae0ab62642e61ea74b156
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-02 04:41:54 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
41f7c7bc64 [IMP] website(_sale): filter products by price with custom range input
When browsing the eCommerce part of the website, customers
should be able to filter shop products based on base sale price.

Desired behavior after PR is merged:
The filter slider can be enabled through the customize menu and it only
filters using the product's base price (for performance reason) and takes
into account currency conversions, not pricelists and discounts. It uses a
custom-built library for the range input with 2 cursors (min. price and max. price).

The slider is hidden when all products shown on the current page
 (category, etc.) have the same price (or there is only one product).

A more advanced version of this implementation would enable the filtering to
take more factors into account.

task-2603014

closes odoo/odoo#74575

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: fja-odoo <fja@odoo.com>
Co-authored-by: Kamen Zhekov <kzh@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2021-09-01 19:07:55 +00:00
stefanorigano (SRI) 7d11b5fcd0 [IMP] website: configurator, handle svg preview text readability
Handle text and other components readability when placed over a colored
background. Both the element and the underlying bg must use the same
color, eg [fill="#FFF"].

closes odoo/odoo#75834

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-01 16:23:07 +00:00
Sébastien Mottet (oms) 2f54d2ad3b [IMP] website: put emphasis on recommended palette selection
Add a button for the selection of the recommended palette. Clicking
on the generated palette to select it doesn't seem to be directly
understood by the user. This button is here to grab its attention
and avoid the confusion.

task-2602521

closes odoo/odoo#75647

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-31 23:35:36 +00:00
qsm-odoo 014446f84b [FIX] web_editor, website: combine dataset "image" and "img" keys
Commit [1] introduced a new "image" option instead of fixing the "img"
option which already existed. Also it created a <img> tag with a "fa-fw"
class which does not make much sense. Also, our system with data-img
actually creates a <svg> tag so that the color of the icon is the one
decided in our SCSS instead of the one hardcoded in the image and so
that there is an hover effect.

[1]: https://github.com/odoo/odoo/commit/02ccad3200187724d5f133842032981fb91f7465

closes odoo/odoo#75743

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-31 10:01:20 +00:00
stefanorigano (SRI) 9337562cca [REF] web_editor, *: review editor toolbar design
*: web, website

This commit redesigns the editor toolbar improving its visual appearance
and introducing substantial changes wherever it is rendered.

== "Into-sidebar" design
The grid layout has been refined, improving its components allocation.
For the sake of visual simplification, "list-type" buttons have been
unwrapped from their original dropdown. For the same reason the button
to create a new table has been removed (users will have to use the
command-bar to create a new table).
Table's options have been moved to a section "ad-hoc", visible only when
a table is selected.

== Floating design (backend only)
The toolbar is now white to match the command-bar design.
In order to simplify frontend inheritance, the floating toolbar now uses
grid layout.

== Colorpicker
The generic code necessary for each design has been moved from
'wysiwyg_snippets.scss' to 'wysiwyg.scss'.
The style is now controlled by css variables allowing to customize
critical design properties without the need of SCSS overrides.
By default the design is white(-ish) to match the floating toolbar,
while in 'wysiwyg_snippets.scss' the variables are customized to get the
typical sidebar's dark feel.

Note: despite the task main objective was just to improve/fix the
design, this aimed to simplify design inheritance and reduce the css
too. While inheritance has been improved reducing the amount of
overrides, the attempt to reduce the css partially failed (in the final
lines count must be considered that a new sidebar section has been
created).
The reason is that we currently suffer from a deep and complicated
inheritance structure for this component. The xml template uses default
bootstrap classes that are styled differently depending if loaded in a
community or enterprise environment. This approach leads to overrides
that must cover all the scenarios while further customization must be
taken in account too 'cause the toolbar can be rendered into the sidebar
with a totally different design.

A possible solution would be to detach from bootstrap directly in the
lib using custom classes names, and then @​extend these classes
differently according to the current environment but probably not a good
idea as we want the toolbar to use bootstrap for in-website editors (so
they can match the theme correctly) but this has to be reviewed as well
anyway. To be checked.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

closes odoo/odoo#73565

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-31 10:00:46 +00:00
Philémon van Helden 02ccad3200 [IMP] web_editor, website: replace light bulb with palette
In master, in the 'Theme' tab of the website editor, the button to edit
color schemes has a light bulb icon, which doesn't clearly represent what
it does.

In this commit, we replace it with a palette SVG. Since we-select
elements do not have an image option implemented, we also add one
for future usage.

task-2618494

closes odoo/odoo#75730

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-30 10:59:16 +00:00
Philémon van Helden 6336d1ba35 [IMP] website: allow embed code snippet to be dropped as a child
In master, the embed code snippet can only be dropped as a sibling.

In this commit, we allow dropping it as a child, by giving it the same
options as the countdown snippet.

task-2618494

Part-of: odoo/odoo#75730
2021-08-30 10:59:15 +00:00
Jeremy Kersten ef531afe39 [IMP] website(_sale): allow to force numberOfRecord for dynamic snippet
Now you can specify into the dynamic_filter_template the number of record to
use for desktop, mobile, and the number of record to fetch.

Some template have only sense to be shown with 1 record e.g. a full width.

Syntax:
Add on root element one or more of these attributes:
  data-number-of-elements="2"  -> number of record on Desktop
  data-number-of-elements-sm="2" -> number of record on Mobile
  data-number-of-elements-fetch="2" -> number of record to fetch

closes odoo/odoo#75662

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-27 18:46:15 +00:00
Younn Olivier 66921786ca [FIX] website: properly define snippets for footer and header templates
Some footer and header templates, introduced in [1] were using snippet
classes without the snippet data attribute. Therefore, they were not
using the snippets versioning system.

For example, the template_footer_descriptive was using an outdated
version of the s_title snippet, when a V001 css version had already been
introduced by [2].

[1]: 34ed29cbac80180982c9acc86c1412433bb88919
[2]: f34d7f4fab

task-2212216

closes odoo/odoo#75670

X-original-commit: bc4091e3049257a4517e556d51b2ed8e06e2095e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-26 20:40:04 +00:00
Sébastien Mottet (oms) 23915c7113 [IMP] website: add saas version in calls to website.api.odoo.com
The saas version of the client is added in each call to
website.api.odoo.com. This allows the server to return
different results based on the client's saas version

task-2602521

closes odoo/odoo#75617

X-original-commit: 6e1ae856584048912cb5eaf53c0aa027b2342b5c
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-26 10:21:38 +00:00
qsm-odoo ea108e3910 [FIX] web_editor: review snippet drag and drop technical flow
This commit completes [1] by further reviewing the drag and drop
technical flow order:

- The content_changed event should be triggered before starting snippets
  as well as it is only useful to signal the snippet modifications made
  by onBuilt.

- The undroppable snippets update which was done first could probably be
  done anywhere -> best to put it at the end when everything in the DOM
  is done, and it is also the last thing the user expects to be done.

Note: in the new editor the role of 'content_changed' became however
unclear and should be further reviewed. This commit fixes problems with
the old flow in master though (problems around removing items in a
snippet during its onBuilt call).

[1]: https://github.com/odoo/odoo/commit/60d7bf6d7daea83db9332b4fc47a4ac6892d21d7

closes odoo/odoo#75596

X-original-commit: efdfe261afd933972869305fd3358c764f7c18c3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-26 10:21:32 +00:00
Xavier-Do fdaee845d5 [FIX] base: remove options parameters
Regarding previous commit, the option parameter can be removed
from _get_asset_content api, followed by a nice snowball effect.

Part-of: odoo/odoo#75248
2021-08-26 10:21:10 +00:00
Benoit Socias 1aa9a7d76d [FIX] website: avoid losing link focus when clicking on popover
Before this commit clicking between the buttons of the link popover
widget did deselect the link. When this happened, if edit was clicked
and the edited link was one within the popover widget instead of the one
on the page.

After this commit clicking on the popover between the buttons has no
effect anymore.

task-2630257

closes odoo/odoo#75544

X-original-commit: 536f72333297ea70cd06c83d92ab0d8f25c0142e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso-odoo@users.noreply.github.com>
2021-08-25 12:02:03 +00:00
qsm-odoo 085f388b5e [FIX] website: ensure more robust link popover creation
Somehow, trying to forward-port the work done at [1] makes it impossible
for the link popover tour test to pass (although that test already
existed in the version where that original work was merged). It's
unclear why the test did not fail before but hopefully it did here: this
reveals a race condition in the editor code where the link popover is
fully shown to the user while clicking on some of its button would have
no effect... because those rely on clicking in the editor panel which is
potentially not up-to-date yet.

This commit fixes the problem in a hacky way, waiting for the editor
panel to be updated before showing the popover but it should not be
necessary in a better refactored codebase.

[1]: https://github.com/odoo/odoo/pull/74861

Part of https://github.com/odoo/odoo/pull/74959
2021-08-24 09:27:35 +00:00
c90ab7b664 [IMP] website: add templates for masonry snippet
Add an option in the masonry snippet's allowing to choose among multiple
templates for the snippet layout. The usability of the snippet also has
been reviewed (restrict the ability to control background on deeper
boxes). Also reviewed the bg-200 use on boxes and replaced them with
a preset as otherwise it seems buggy to not be able to remove the
bg-200 by selecting a preset (other than hitting the trash icon in the
colorpicker).

Part of https://github.com/odoo/odoo/pull/67361
task-2463033

closes odoo/odoo#67361

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: smottet <oms@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-08-23 12:20:17 +00:00
qsm-odoo bebb45e6d5 [FIX] website: restore the masonry snippet's options
Since [1], it was not possible to control the color of colored boxes in
the masonry snippet. Hopefully, the new selector to exclude some options
on "snippets inside snippets" is now more limited.

[1]: https://github.com/odoo/odoo/commit/58503a248e7ab6b66d61d00869cdae6719e5a068

Part of https://github.com/odoo/odoo/pull/67361
task-2463033
2021-08-23 12:13:14 +00:00
dht-odoo 3147fb4237 [IMP] {website}_livechat: improve action helper messages
This commit improves action helper message for visitors menus of
website and removes old action helper message from visitor menu
of livechat for better onboarding.

Menus

1) Visitors(action -> website_visitors_action)

Task-2584073
PR odoo/odoo#74082

Related: odoo/enterprise#20125
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-20 13:11:15 +00:00
qsm-odoo 3845b650e6 [FIX] website: make robust IDs for visibility conditions on snippets
As nicely pointed by @kig-odoo at [1], the new feature of snippet
visibility conditions introduced in [2] has some issues. This fixes
the fact that condition identifiers were built by combining IDs without
a separator. A condition targeting a lang with ID:4 and another one with
ID:5 could thus produce the same condition identifier as another
condition targeting a lang with ID:45 (as 4 and 5 side-by-side makes
45...). Now, all parts of the identifiers are separated with '_'.

[1]: https://github.com/odoo/odoo/pull/67140#issuecomment-902531321
[2]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05df

closes odoo/odoo#75386

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-20 12:14:24 +00:00
Romain Derie fd54179ceb [FIX] website_mass_mailing: improve configuration usability
1. The option to change newsletter becomes a select instead of a button that
   open a modal
2. If no mailing list exists, we show a warning and user can be redirected to
   the backend to create one if he wants.
3. Add name to the snippet so it is not "Block" in the right panel

Community: https://github.com/odoo/odoo/pull/74667
Upgrade: https://github.com/odoo/upgrade/pull/2742
task-2246975

closes odoo/odoo#74667

Related: odoo/upgrade#2742
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-20 12:05:23 +00:00
Romain Derie 8873fe7240 [IMP] (website)_mass_mailing: make newsletter popup use popup snippet
Before this commit, the newsletter popup was using its own mechanism instead of
the popup snippet, making a lot of extra code.

Now, the newsletter popup snippet just use the behavior of both the popup
snippet and the newsletter snippet.

Community: https://github.com/odoo/odoo/pull/74667
Upgrade: https://github.com/odoo/upgrade/pull/2742
task-2246975
2021-08-20 12:05:06 +00:00
Sébastien Mottet (oms) 8c10765ef9 [IMP] website: avoid colors mitigation for configurator logo
The algorithm extracting primary and secondary colors from
an image automatically mitigates too bright colors. A color
component is considered as too bright if its value is above
an arbitrary value. We re-use this algorithm in the website
configurator to extract colors from logo and to generate a
palette. In this particular case we don't want the mitigation
to be applied. We therefore added the mitigation threshold as
a parameter of 'extract_image_primary_secondary_colors' and
avoided any mitigation by setting it to 255 in our case.

task-2602521

closes odoo/odoo#75255

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-19 09:23:27 +00:00