Commit Graph
7336 Commits
Author SHA1 Message Date
Guillaume (gdi) eb2f85d838 [FIX] website: remove an option from the facebook block
Facebook no longer supports the option to see the profile pictures of
friends who have liked the page. So this commit removes the option
(which was no longer useful). See [same issue at WordPress].

[same issue at WordPress]: https://wordpress.org/support/topic/facebook-likebox-disappearance-of-the-faces-of-friends-who-like-the-page/

task-2950329

closes odoo/odoo#98502

X-original-commit: d2657b5272cdbd6bdf3918d97acdcf2d829076d3
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-22 15:26:00 +02:00
luvi ffb8823c1f [FIX] crm,*: fix styling issues in settings
*: point_of_sale, website

This commit fixes the style of the settings affected
by changes during the conversion to Owl.

Because of the new DOM of fields, some elements displayed
using the 'row' class were not horizontally aligned
because of the changes made to the DOM of the field that
were used. As the layout have changed, it was needed to
adapt and add new styling class in the template.

closes odoo/odoo#98387

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-19 11:52:59 +02:00
Romeo Fragomeli bff483f4a3 [FIX] payment,website: Deletes and migrates col-*-offset- BS3 class
This rule has no effect for a while!

In settings, we had to delete it because converting it would add
space in the first column.

In payment, it seems that this offset was used to center the content.
We prefer to convert it.

closes odoo/odoo#98438

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-19 10:31:24 +02:00
Romeo Fragomeli cf4f23d484 [FIX] web,*: adapt old BS4 classes
*: hr_org_chart,l10n_gcc_invoice_stock_account,mail,point_of_sale,
   purchase,website,website_sale,website_sale_autocomplete,
   website_slides_survey

Some commit have added old Bootstrap 4 classes after the merge of
Bootstrap 5.

Note that it's not possible anymore as the merge bot is now able to
detect it.

closes odoo/odoo#98349

Related: odoo/enterprise#30551
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-18 16:47:30 +02:00
Benjamin Vray bf5eabd03d [FIX] website: hide logo height scrolled option if no logo
Before this commit, the logo height scrolled option was displayed even
if there was no logo.

It was because the condition to display or not this option (in the
"_computeWidgetVisibility") had not been updated correctly when the DOM
of the navbar was refactored.

task-2800680

closes odoo/odoo#98321

X-original-commit: 2b2ff732914e6c491e48540958bec967a3acfe33
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-18 13:46:31 +02:00
Romain Derie 35805108a7 [FIX] website: display website in ir.ui.view relation fields
Since [1], the ir.ui.view name_get can suffix the name with the website,
something like `Main Layout [Website 1]` instead of just `Main Layout`.
This is fundamental when managing a DB as with the multi website / COW
mechanism, views are duplicated, making it impossible to know which one
is coming from which website (or is the generic one) when selecting a
new record in a field input.

While it worked great for the autocomplete list, the default value when
loading the form/list views were still not displaying the website.
You thus have the same issue: you have to navigate to that view to
figure which one it is.
When managing multi website DBs, this is becoming tricky.

This commit also adds that behavior to the value shown when loading a
form/tree view.

[1]: https://github.com/odoo/odoo/commit/ea3a2ab6788980a8961d9b9a3f88bc13c15a3c46

closes odoo/odoo#98320

X-original-commit: d66f8649a8f18fc67a595dd5254d1aeb680c29c6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-18 00:23:43 +02:00
Adrien Dieudonné 358194e99a [FIX] website: searchbar: wrong usage of BS dropdown
Before this commit, we had a crash when a user types something in a
searchbar in the website (on /shop eg) and do keydowns:
"Cannot read properties of undefined (reading 'nextElementSibling')"

BS dropdown doesn't use JQuery anymore and is therefore less permissive
with empty arrays. Also note that the logic is different between BS4
and BS5.

To fix this, we need to make sure that all elements are in the DOM
before BS dropdown instanciation.
It's why we have to render the 'dropdown-menu' before the dropdown
constructor is triggered.

We also had to add the 'data-bs-toggle' attribute to let BS find it
to set '_element' (which must be the previous sibling of the dropdown-menu).
This data attribute was probably not set before because in this case
the BS dropdown is not used on a button or a link as documented;
we use it as an autocomplete functionnality.

closes odoo/odoo#98254

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-17 19:48:43 +02:00
Romain Derie 5ad404fbb5 [REM] website, *: remove the now useless backend_dashboard tour
* website_sale

That tour keeps failing. A fix attempt was made with [1] but wasn't
enough.
The tour was actually useless as since [2] google analytics dashboard
was not part of the website dashboard anymore (due to google not
allowing GA4 dashboard to be embed).
The tour, which was initially made to ensure that google analytics was
correctly shown even if not yet connected to was then not useful
anymore.

The opportunity is also taken to rename the misleading ID of related
records still mentioning Google.

[1]: https://github.com/odoo/odoo/commit/1a191357e3ac0c4542b2fc7c3a2aee18dc54699d
[2]: https://github.com/odoo/odoo/commit/985e49bdb5e22fa197ba267aa41d7a8ba7e50550

runbot-4498
runbot-4499
runbot-4466

closes odoo/odoo#98090

Related: odoo/upgrade#3774
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-17 19:48:28 +02:00
Guillaume (gdi) caf1ca67e9 [FIX] website: permit to open the image wall modal correctly
Since the bootstrap 5 merge at [1], when you click on an image in the
Image Wall block, the modal no longer opens. This commit restores that
and adds a test to make sure this problem does not happen again.

Steps to reproduce:
- Drop the "Image wall" block in a page
- Save
- Click on an image
-> The modal does not open

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968

task-2937538

closes odoo/odoo#97053

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-17 19:48:21 +02:00
Benjamin Vrayandqsm-odoo a2a71ae2a1 [FIX] website: fix logo options not displayed if text logo
Before this commit, the logo options (type, height, height scrolled)
were not displayed if the logo type was "Text".

After this commit, these options are moved to the navbar section so that
they are always displayed if the logo is "Text" or "Image". And if the
logo type is "None" only the logo type selector is displayed. Just like
it was in 14.0.

task-2800680

closes odoo/odoo#98229

X-original-commit: cddf06da77cb7be2219f2f539d13a90ca53d9178
Related: odoo/upgrade#3781
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-08-17 12:45:05 +02:00
xO-Tx 4b79788889 [FIX] website: fix page properties auto save
Issue:

1- Go to page properties > change the URL of a page.
2- A list of dependencies appears on a popover.
3- Click on a dependency > you are redirected to the related object
but the URL change for your page was "saved".

The changes on form views are automatically saved when the view is left
using a "beforeunload" handler.

The goal of this commit is to fix this behaviour by making website page
dependency links "_blank".

task-2687506

closes odoo/odoo#98180

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-17 12:44:55 +02:00
xO-Tx 575c0f9646 [IMP] web, *: update page properties dialog size
*: website

The goal of this commit is to tweak props on 'FormViewDialog' component
to be able to change dialog size (since 'props.size' is already used
by its 'Dialog' sub component).

Follows the merge of the "website in backend" task at [1].

[1]: 31cc10b

task-2687506

Part-of: odoo/odoo#98180
2022-08-17 12:44:55 +02:00
xO-Tx 74ab655253 [FIX] website: adapt page dependencies to BS5
The goal of this commit is to fix website page dependency popover by
adapting its template to BS5.

task-2687506

Part-of: odoo/odoo#98180
2022-08-17 12:44:54 +02:00
Antoine Guenet 737479b25b [ADD] web_editor, website: commands to convert text into columns
This adds commands to convert the current text into 2, 3 or 4 columns,
and to remove said columns.

task-2901585

closes odoo/odoo#95359

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-16 17:49:58 +02:00
Tom De Caluwé 8c534f8724 [IMP] website: add languages field in the website creation modal
Allow the user to select multiple languages in the website creation modal.

task-2745347

closes odoo/odoo#86541

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-16 17:49:46 +02:00
xO-Tx 61a9d7bd2a [REF] website: adapt website page fields to OWL
Since updating page properties means updating fields on the
'website.page' record, a 'page form view' was used to replace the
frontend page properties dialog at [1].

The goal of this commit is to update the fields used for website page to
work with the new OWL form views.

Follows the merge of the "website in backend" task at [1].

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#97343
2022-08-16 16:28:04 +02:00
xO-Tx bf34319005 [REF] website: use formViewDialog OWL component
After [1], the frontend 'page properties' dialog was replaced by a 'form
view dialog' of the current 'website.page'.

The dialog structure in [1] was based on a 'PagePropertiesDialogWrapper'
component that handles a 'legacy formViewDialog' widget of the page.

Since 'FormViewDialog' is available as OWL component (starting from [2]),
we can now simplify the current code from:

A- 'PagePropertiesDialogWrapper': creates & opens a legacy FormViewDialog.

to:

B- 'PagePropertiesDialog' (the page formViewDialog): can simply be added
using 'dialog service'.

Remark: a wrapper ('PagePropertiesDialogManager' component) is used
temporarily by the legacy 'website.page' listView to add
'PagePropertiesDialog','DuplicatePageDialog' & 'DeletePageDialog'.
This component should be removed after the update of the listView to OWL
and components will be added using 'dialog service' as in the website
navbar menu code.

Follows the merge of the 'website in backend' task at [1].

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/48ef812a635f70571b395f82ffdb2969ce99da9e

task-2687506

Part-of: odoo/odoo#97343
2022-08-16 16:28:04 +02:00
Benoit Socias 98e00bdb58 [FIX] website: allow retrying if website configurator fails
Whenever an error happens during the website creation after the last
step of the website configurator, it is displayed as an notification
popup, but it keeps the UI blocked, preventing the user from retrying
the operation.
The usually observed error is about not being able to install the module
or theme because a cron is in progress. The message actually asks the
user to retry later.

This commit does the following upon errors happening during the website
creation:
- silently retry after 5 seconds, up to 3 times
- after all attempts failed, display the error and release the UI and
allow for manual retry.

task-2809434

closes odoo/odoo#98124

X-original-commit: 2afdbc7181de3c87c1021f1e06d059ffe059ede0
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-16 15:06:52 +02:00
Romain Estievenart 0de5d77765 [IMP] website_*: uniformize pager position on center
Before this commit, the pager was on the left or centered.
Now, it is always centered regardless of the website pages (portal or
not).

closes odoo/odoo#97967

Related: odoo/enterprise#30343
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-16 09:19:08 +02:00
Romain Estievenart 36628c9b1c [FIX] *: removes .form-inline
this commit removes the usage of .form-inline class which is deprecated
since BS5.

here is the css rules that was used:
https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L2303

'''Breaking change: Dropped form-specific layout classes for our grid
system.
Use our grid and utilities instead of .form-group, .form-row, or
.form-inline.'''

https://getbootstrap.com/docs/5.0/migration/#forms

We also took the opportunity to remove some .input-group-append and
.form-group. We are currently working to remove all of them.

Part-of: odoo/odoo#97967
2022-08-16 09:19:08 +02:00
Romain Derie 4dd344b1e6 [IMP] website: improve frontend mini UI navbar
- Make the animation smoother and less prompt to bad UX:
  1. The animation duration of the closing part is now slower. Somehow
     it looked like the closing animation was faster than the opening.
  2. The animation delay of the closing part is now bigger. It will
     prevent some weird UX issues when the cursor is moving out of
     the window by mistake (eg moving a bit too far in the bookmarks
     bar or the Ubuntu left panel for instance). In those case, despite
     the user wanting to open and click inside the navbar, it would
     directly close it.
- Make the edit button only visible for editors
- Make the go to backend button only visible for internal users (not
  portal anymore)
- Restore a behavior that was lost during the frontend > backend task
  [1]: clicking on the app switcher in community should show the list of
  apps so you can directly access where you want to go in the backend.
  It improves the usability in community where you otherwise have to
  click twice every time as the first click always brings you to the
  discuss module from where you have to click again on the app switcher
  to select the app you wanted to land on.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

closes odoo/odoo#97745

Related: odoo/enterprise#30218
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-12 23:37:28 +02:00
Thibault Delavallée 3902ae3b18 [MOV] base_automation, sms, website: move server actions code in their own files
Purpose is to ease finding server actions code and views. We just rename
some files and move some code, nothing should change functionally.

Task-2613245 (Server actions cleaning and mail update)

Part-of: odoo/odoo#75906
2022-08-12 23:37:02 +02:00
Benoit Socias 4c7074c454 [FIX] website: fix image alignment in search results
Since [1] when Bootstrap 5 was introduced, the images of search results
are not aligned anymore. This is because the detail part of the result
has been set to `flex-grow-1`.

This commit restores the former flex parameterisation through a new
class. The fix is applied both on the autocomplete results template and
the hybrid results element template (used to render `/website/search`).

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968

task-2951028

closes odoo/odoo#97944

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-11 17:57:09 +02:00
xO-Tx 8a3c882de8 [FIX] website: adapt new page dialog UI
The goal of this commit is to fix "New Page Dialog" margin issue
related to the use of '.form-group' CSS (dropped on BS5) and replace
it with a simple row gutter.

closes odoo/odoo#97919

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-11 17:56:54 +02:00
Arthur Detroux (ard) c6524ee9d6 [FIX] website: adapt carousel options to BS5
Commit [1] migrated to Bootstrap 5 using automation. This mistakenly
changed attributes related to Snippet Options.
Commit [2] moved the website edition in the backend which created a
conflict with the tooltip system of the editor ([data-tooltip="true"])
and the tooltip system of the backend ([data-tooltip="content"]).

This commit fixes both these issues by changing the XML and removing the
related js code.

[1]: https://github.com/odoo/odoo/commit/1fcd098af5fa18e848c66bb83bdceb6ba0308512
[2]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#94564

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-10 20:28:49 +02:00
Arthur Detroux (ard) f7055d3dba [FIX] website: adapt bootstrap elements' options to iframe edition
Commit [1] moved the edition of website from the frontend to the backend
and in doing so, introduced an iframe from which the website is edited.
This broke some behaviours as the event binding for jQuery widgets (such
as the carousel) is no longer done from the same jQuery as the editor.
So bootstrap events triggered inside the iframe do not reach options
that are listening using the top window's jQuery (simple $()).

This commit adds the $bsTarget property to the SnippetOption class.
It wraps $target[0] using the iframe's jQuery instance.
This allows for options to listen to bootstrap events.
(using $bsTarget.on)

Options that were doing that previously are adapted by this commit.
(Carousel, Popup, Accordion (collapse))

Note: Popup was already adapted locally (by [2]), this commit only
changes its use of an $iframeTarget property to the $bsTarget one.

This commit also fixes "Add item" on accordion snippet to properly
assign a unique ID to the new tab.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:49 +02:00
Arthur Detroux (ard) ddf2e74b4c [FIX] website: fix gray color picker
Commit [1] changed the way styles are handled. Now that the edition of
website is done in an iframe, the styles are computed inside the iframe
instead of the top window / global document element.

But for computing the gray colors, a base style defined
by `web_editor/color_palette.scss` is needed. This style is not part of
the frontend assets, so using the iframe to fetch it creates bogus gray,
which results in the feature not working.

Steps to reproduce:
- Go on the website editor
- Select the THEME tab
- At the bottom expand the gray color picker
- Use the settings
- The preview is not updated while sliding.
- The colors are not updated in the page.

This commit fixes the bug by fetching the base style from the top
window (where backend assets are present).

[1]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Arthur Detroux (ard) 4292ed0e35 [FIX] website: re-enable action buttons when canceling discard dialog
Steps to reproduce:
- Go on website
- Click on edit
- Add a snippet
- Click on discard
- Close the popup using the 'X' at the top of the popup
- Buttons are still disabled

Commit [1] adapted the website dialogs to the OWL Api but also
introduced this bug.

This commit fixes that behaviour and re-enables the buttons
if the popup is closed.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Arthur Detroux (ard) 24ca4ae3fb [FIX] website: (re)start widgets on a cloned snippet
Commit [1] moved the website builder in the backend and in doing so
transferred event handling to the wysiwyg_adapter from the edit button
widget. Unfortunately, during that process, handling of event for
cloned snippets was forgotten.

This commit restores that and adds a test.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Benoit Socias 5ad3451b37 [FIX] website: avoid double-escape of pages search results
Since [1] when the search bar was refactored, a search facility was
added on website pages and the rendering of those search results did
not correctly handle the HTML escaping.

This is related to the fact that the `ir_ui_view`'s `arch_db` field is
stored with this double escaping on text nodes, which is done by
`wysiwyg.js` through the `_getEscapedElement` method since [2].

This commit unescapes the last layer of `&amp;` before extracting the
page's text for generating the search results.

Steps to reproduce:
- Add some "&", "<" or ">" characters in a page.
- Use the search snippet to lookup for the page.
=> The results in both autocomplete and the results pages display the
content with an extra unwanted escaping (&amp;...)

[1]: https://github.com/odoo/odoo/commit/9f9c4bb7e40233e633f97c60fb00ae191e9077af
[2]: https://github.com/odoo/odoo/commit/f5acea7f9ce232773ec3adf1828a3d18bbedee1e

opw-2908645

closes odoo/odoo#97748

X-original-commit: 2b95dcdb0d8b49bac8ee38a8d062112468124012
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-09 11:32:14 +02:00
Younn Olivier 1a191357e3 [FIX] website: fix backend_dashboard tour
The tour .test_03_backend_dashboard was failing inconsistently with a
"failed to fetch" error (which happens when fetching the frontend
assets, from the iframe).

The test is adapted to start directly in the backend, which seems to
prevent that error from happening.
It is also adapted to [1] which was merged during the investigation of
that error.

[1]: https://github.com/odoo/odoo/commit/985e49bdb5e22fa197ba267aa41d7a8ba7e50550

runbot-4418
runbot-4003

Part-of: odoo/odoo#95890
2022-08-09 11:31:59 +02:00
Younn Olivier 822ed36e2c [FIX] website: restore help message in edit menu dialog
This commit restores the hint that [1] lost when adapting the "Edit
menu" dialog to owl.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#97733

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-09 07:48:05 +02:00
Benoit Socias 6179adb555 [FIX] website, test_website: fallback on exact search if max reached
For performance reasons, when fuzzy search was introduces it was
decided to limit the number of records used for finding fuzzy terms to
1000.  Because of this, when a database contains more than 1000
products matching words that start with the same letter, further
products are not examined. This can lead to searches not finding an
existing exact match.

This commit introduces a fallback mechanism so that, if we are in a
situation where the maximum number of examined records was fetched, we
also explicitly check for a possible exact match across all records.

Steps to reproduce:
- Do not install the pg_trgm extension.
- Have more than 1000 products containing searchable words (name,
description...) starting with the same letter.
- Add one more such product (so that it is not in the 1000 first ones).
- Search for that last product by correctly typing the word.
=> Exact match was not returned.

task-2870947

closes odoo/odoo#97657

X-original-commit: 6d24ea28b236155d542e3d2be3da379b9f4e9ce6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-08 23:45:53 +02:00
Romain Derie 32a37003c9 [FIX] website: prevent js recursion error with form visibility
Before this commit, it was possible to make the JS crash due to maximum
call stack reached due to some recursion between 2 field visibility.
It was then preventing the page to even be accessed as it is the 000.js
(public file) which is failing.
The only way to fix that is then to go through the backend.

Step to reproduce:
- Enter edit mode and drag & drop a form snippet on the page
- Select a field, let's call it field_a
- Set its visibility option in the right panel to "Visible only if" and
  select another field as value, let's call it field_b
- Now select field_b and do the same operation and set field_a as value
- Save

After save, the 000.js file will be executed and the traceback will
occur, preventing the page to work at all.

Note that the illustrated example is about direct and obvious circular
dependency, but it could also be about indirect circular dependency like
field_a depends of field_b, field_b depends of field_c and field_c
depends of field_a.

opw-2889860

closes odoo/odoo#97652

X-original-commit: 90ecfab61f0c71850c1f3bc3ab2644883d18f9a5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 23:45:45 +02:00
Antoine Guenet 8e1f9fffc8 [IMP] web_editor, mass_mailing, website: reorganize Powerbox items
This reorganizes the Powerbox items under different category names, in a
more preferable order.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:00 +02:00
Antoine Guenet 9154e707df [ADD] web_editor, website: new API to organize Powerbox
This introduces a new API for the Powerbox, which allows to order its
commands and categories. The order is based on the priority assigned to
the category or command. If two items have the same priority, they are
ordered alphabetically.
To order categories, pass said categories in the Powerbox's params, each
with its own priority. If a command declares itself as part of a
category that was not itself declared, said category will be added
automatically, with the lowest priority.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:00 +02:00
Géry Debongnie 9434969d5d [REF] website: reimplement redirect field in owl
The redirect field in website does not work properly in the new views.
With this commit, we just reimplement it to make it work with the new
code.

closes odoo/odoo#96865

Related: odoo/enterprise#30178
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 12:33:12 +02:00
Younn Olivier 29dcb119f5 [FIX] website: copy frontend link when using the anchor option
Before this commit, clicking on the "anchor" icon from a snippet editor
would copy the client action's url (introduced in [1]).

This commit changes the snippet's path computation to use the target's
ownerDocument location instead of the global one.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier b0108e1876 [FIX] website: fix editor keyboard shortcuts
Before this commit, the editor shortcuts would not work.
Example: "alt+1", or "alt+2" switch tab of the editor.

This commit registers the editor as the active element, so that keyboard
shortcuts registered on that element are given priority at the hotkey
service level. The "escape" shortcut to go fullscreen is adapted with
the global option to be independent from the active element.

This commit also adds the "alt+p" keyboard shortcut on the publish
systray item.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 83501e38a3 [FIX] website: ignore context params when client action is restored
Before this commit, the website context was configured with the params
of the client action, at all times. This was leading to weird
behaviours:
- Go to the website client action
- Install the "Blogs" module from the new content systray item
- Navigate on a blog post from the client action
- Click on the "Settings" systray item (last one from the right)
- Click on the "Website Preview" breadcrumb item
=> The "New Content" modal is displayed, again, when it should not.

Another flow, on enterprise:
- Start the client action with /@/?enable_editor=1
- Click on the top left icon to go back to the home screen
- Click on the top left icon to go back to the website
=> The editor is launched when it should not.

To prevent that, the action jsId key is registered at the website
service level. If the action is restored, the jsId will be the same, and
the params used to configure the context will be ignored.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 9a542f121b [FIX] website: fix theme options background widget state
Before this commit, the Page Layout > Background option's widget of the
Theme section of the SnippetsMenu was not updated correctly after using
the option.
The #wrapwrap was queried in the global document when it should be
queried in the target's ownerDocument.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Younn Olivier e8112e2865 [FIX] website: keep focus on text when using snippet options
Before [1] was merged, for this flow:
- Drop a snippet in the page
- Click on some paragraph
- Click on a snippet option's widget
=> The text selection was lost on Chrome, but kept on Firefox.

With [1] instantiating the SnippetsMenu on a different document than the
snippets one, it was possible to keep the text selection (the snippets
document selection) when clicking on the snippets options (on the global
document).
Some code was added to preserve the Chrome behaviour and lose the text
selection. This code is reverted to keep the Firefox behaviour.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Romain Derie 7f1653a1de [IMP] website: remove the iframefallback in test mode
This commit gets rid of the iframefallback in test mode. It is not
helpful there and slows down the tests as it involves some HTTP
requests.
Its purpose is only for the end users to have a smoother UX during page
transition. It is irrelevant in tests. Note that it means the tests
wouldn't break if that iframe fallback was to be breaking something in
real use cases.

task-2687506

closes odoo/odoo#96229

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 10:50:56 +02:00
Arthur Detroux (ard) 6d185fd085 [FIX] website: fix dynamic snippet render issues
Prior to this commit, if an user chose to fetch 16 elements, the snippet
would bug out and display 16 elements per row.

Steps to reproduce:
- Install website_sale
- Drop a product snippet
- Select 16 fetched elements
- Layout is broken

Some legacy code introduced in [1] could result in an infinite loading
animation locking the editor out. This commit removes the code as a
fix made at [2] makes it unneeded.

Steps to reproduce:
- Install website_sale
- Enable debug mode
- Drop a "Dynamic Snippet Carousel"
- Click on the Dynamic Snippet for edit
- Sometimes the editor hangs and the page needs to be refreshed

[1]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5
[2]: https://github.com/odoo/odoo/commit/ac8d83cc124a6175a263e11795fda35eebe69324

Related to task-2677203

closes odoo/odoo#97502

X-original-commit: 5ef31db8599d5dbe7ed07c88ac1c703bd7287345
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-05 04:44:51 +02:00
Benoit Socias dcd1ee109b [FIX] website: not record header animation in editor history
Before this commit when the header scroll effect was happening, the
related DOM updates were recorded in the editor's history.

This commit deactivates the history during the updates of the header.

Steps to reproduce:
- Drop a "Text" block in the page.
- Drop 4 "Banner" blocks below the "Text" block to make the page
scrollable.
- Save.
- Edit page.
- DO NOT SCROLL until the last step.
- Select the Text block.
- Delete the Text block.
- Click undo => Text block reappears as expected.
- Click redo => Text block disappears as expected.
- Click undo.
- Scroll down until header vanishes and reappears.
=> Redo step is lost, undo tries to undo the header animation.

task-2930568

closes odoo/odoo#97488

X-original-commit: c710f73f84ce798b8363b7f8904f96b9eacd56dc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-05 03:38:26 +02:00
Romain Derie 1ac43fab05 [IMP] website: fix python linter errors
Just a nice to have. It will prevent those errors to be replicated when
copy pasted and will help reading the files in the IDE.

closes odoo/odoo#97282

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-04 20:11:00 +02:00
qsm-odoo 29613c6ec4 [FIX] web_editor: fix the look of the indent symbol in the editor panel
As a stable fix, to not touch XML templates and break existing
translations, the ⌙ character was automatically replaced by └ which
makes more sense for the usecase and should work properly in all
browsers. The ⌙ character is actually rendered mirrored on Windows 11
Chrome (and others) as the font used for those unicode characters is
left to the browser. We could force a font of our own but it's probably
not worth it.

A better solution with a SVG or CSS solution has to be done in master.
That would unify the look of the symbol across all browsers and
also prevent special characters to be placed in translations.

With this forward-port commit, we'll start first by using └ via a CSS
rule. Three new classes have been created: o_we_sublevel_1,
o_we_sublevel_2 and o_we_sublevel_3. Adding any of them on a widget
automatically adds the └ character. Then choosing 1, 2 or 3 controls
the indentation, which was previously controlled by placing the &emsp;
HTML entity directly inside strings.

This commit also takes the opportunity to fix some of those level
indentations (sometimes 2 was used instead of 1 or 1 was used instead of
2, etc) and also review some related labels.

closes odoo/odoo#97361

X-original-commit: e5d45643598671077ade7e41f0dbfe2b502665b8
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-04 11:45:31 +02:00
Benoit Socias 5de6b5048a [FIX] web_editor, *: restore defaults before applying preset
*: website, website_sale

Before this commit when a search bar was within a navigation bar, its
autocompletion popover was using the text color according to the
navbar's background color determined by the theme. For dark themes, this
made the autocompletion appear almost as white on white.

This commit uses the defaults before applying a specific preset color
so that the dropdown menu style within the navbar uses the original
color.
It also resets the `text-muted` style used in "No results" message.

Also removing the `website_sale.productsSearchBar.autocomplete` template
which was not referenced anymore.

Steps to reproduce:
- Select a dark palette (e.g. one that makes the navigation bars black).
- Drop a "Products Search" block.
- Reset its background color.
- Pick a color combination with a dark background.
=> The autocompletion's "No results" message is shown without contrast.

task-2855511

X-original-commit: f9bf40cb53cf487c8736c1f565c2f0d3834acd5e
Part-of: odoo/odoo#97148
2022-08-03 20:48:04 +02:00
Romain Derie 701a775ec4 [FIX] website: add longer timeout to long website form test
This test is quite long as it is testing all the website form behaviors
in edit mode.
It is sometime failing due to the tour taking longer than 60 seconds.

runbot-4257

closes odoo/odoo#97336

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-02 18:44:02 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00