Commit Graph
4276 Commits
Author SHA1 Message Date
Brieuc-brdandqsm-odoo c16428cf39 [FIX] web_editor, website: adapt dropzone transparency
Since the introduction of the new dropzone design at [1], the dropzones
were not transparent enough anymore and the inline content behind them
was not readable.

This commit adapts the layout of dropzones to make the content behind
them more readable.

[1]: https://github.com/odoo/odoo/commit/8ca644252e2d3a1f836735454c1f936529a7914e

task-3537616

Part-of: odoo/odoo#137569
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-10-05 15:36:22 +00:00
Michael (mcm) 89693faebb [FIX] web: fix http.post array params
Since [1] an error was thrown when giving multiple files to http.post.
This commit reverts changes in the function but the function now also
allows to give a FormData instead of pojo.

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

closes odoo/odoo#137421

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-05 15:36:19 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Benjamin Vray c6ec2c5e04 [FIX] web_editor, website: fix colorpicker issues related to color names
This commit fixes two bugs with the colorpicker that occur since [1].

Steps to reproduce the 3rd bug:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Save and Edit.
- Go with your mouse over the different colors of the colorpicker (at
least 2).
- Bug: an infinite loader appears on the iframe and prevents from
editing the background color.

Steps to reproduce the color combinations bug:
- Go to Website edit mode.
- Drop a Call to action snippet.
- Change the background color and try to select another preset.
- Bug: the color of the text and buttons is updated, but not the
background color.

Both of these 2 bugs happen after commit [1] because the colorpicker
widget is started before the ColorPalette component is attached to the
DOM (which only happens once the user opens the picker). However, the
colorNames are only set after the setup() of the ColorPalette.
Initializing the colorNames with possible default values is thus
necessary to avoid bugs on `_computeWidgetState()`.

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

task-3440939

closes odoo/odoo#137306

X-original-commit: https://github.com/odoo/odoo/commit/2ccc01175080ddb549660713d6101dd936e0d304
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-04 19:40:20 +00:00
Jorge Pinna Puissant 006ee1fc47 [REF] web, *: remove legacy cookie utils and cookie service
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.

"Om Nom Nom Nom" - Cookie Monster

part-of task-id 3439226

closes odoo/odoo#136782

Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:40 +00:00
Romain Estievenart a4b1c26813 [IMP] web_tour, website: use nested_sortable hooks instead of jQuery
Migrate the website usage of jQuery NestedSortable to the hooks
useNestedSortable

task-3439226

Part-of: odoo/odoo#136375
2023-10-03 19:20:06 +00:00
luvi 5124feae97 [IMP] web, *: improve UX of custom group by menu
*: board, website

This commit simplifies the UX of the 'Custom Group by' menu. Before this
commit, many clicks were needed to apply another filter, from an accordion
menu.

Now, a select element is used instead, allowing a better user experience, by
enabling such group by directly, when an option is selected.

Some tests have been adapted to the new selectors and behaviors, and the
applyGroup and toggleAddCustomGroup has been removed, since groups are applied
when selected, and the value can be modified directly with selectGroup.

task-3458519

closes odoo/odoo#132006

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-03 19:19:53 +00:00
Valeriya(vchu) 2114ad3a03 [IMP] website_sale: auto publish products
users who create products from the website are intended to make it visible immediately for customers
task-3234684

closes odoo/odoo#117884

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-03 19:19:48 +00:00
Brieuc-brd 12031dd6b0 [IMP] website: adapt style of editable fields
This commit adapts the hover style of the editable fields elements to
match the new overlay style.

task-3368793

closes odoo/odoo#132653

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-03 12:52:33 +00:00
Brieuc-brd 8ca644252e [IMP] website, web_editor: redesign the drop zone
This commit adapts the drop zone to maintain consistency with the style
of web editor.

task-3368793

Part-of: odoo/odoo#132653
2023-10-03 12:52:33 +00:00
Guillaume (gdi) 2cede25222 [IMP] website: add Instagram page snippet
This commit adds a new snippet to display an Instagram page on the
website using an iframe that embeds the Instagram page.

task-2603045

closes odoo/odoo#133905

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-02 14:12:46 +00:00
Brieuc-brd b5b94857e7 [IMP] website: add thumbnail for Instagram page snippet
This commit adds a thumbnail for the incoming Instagram page snippet.

task-3495454

Part-of: odoo/odoo#133905
2023-10-02 14:12:46 +00:00
Benjamin Vray ce9b350403 [FIX] website, web: fix dropdown hidden in mobile menu
Steps to reproduce the bug:
- Modify the website's menu to include only two items: a link to a page
and a dropdown menu.
- Switch to mobile preview.
- Open the "Hamburger" menu.
- Click on the dropdown toggle.
- Bug: The dropdown menu is hidden and requires scrolling the navbar to
see it.

Since commit [1], dynamic positioning of dropdowns within a navbar has
been enabled (before that, Bootstrap disabled it) but this change
introduced this bug.

To fix this, we disable dynamic positioning of the dropdowns when they
are inside a "Hamburger" menu.

[1]: https://github.com/odoo/odoo/commit/8689241f86e2d4ddb4e4510951f92b80e115b914

opw-3493512

closes odoo/odoo#137165

X-original-commit: 55bc21c9503bf3b319d94e10d73bf672385b455c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-02 08:03:45 +00:00
Chrysanthe (chgo) c91c221c4c [FIX] web: reintroduce CSS variables for navbar entries
This commit aims to reintroduce CSS variables to handle the different
states of our navbar entries.

Recently, the way we handle the navbar entries changed. Previously, we
used to set CSS variables in Community, which would allow us to control
the color of ours nav entries at every state.

On the Enteprise side, this would allow us to use the different colors we
use for these buttons and style them differently

This approach was also very helpful because we could override these CSS
variables once again to handle the colors of the Studio navbar elements.

Recently, the approach used to control these elements changed :

- On Community, we make use of CSS variables ;
- On Enterprise, we use the Bootstrap `btn-light` class.

Using `btn-light` was a very good approach to ensure that no issues would
appears on our buttons and also to reduce the amount of code needed, but
unfortunately, using `btn-light` directly affects Studio, causing contrast
issues. It was also a bit weird to have CSS variables + Bootstrap classes
being set at the same time.

To fix these issues, we reintroduce CSS variables in Enterprise and Studio,
to fully control the color of our elements and ensure everything is
readable. Most of these variables are defined in Community, inside the
`navbar.scss` file, and we simply override them in Enterprise and Studio.

task-3418936
part of task-3326263

closes odoo/odoo#137140

X-original-commit: af6d914c379953d2deec9833579399f126076194
Related: odoo/enterprise#48174
Signed-off-by: Stefano Rigano (sri) <sri@odoo.com>
Signed-off-by: Chrysanthe Gomrée (chgo) <chgo@odoo.com>
2023-10-02 05:56:04 +00:00
utag-odoo cdbd8d038d [FIX] website: make navbar content invisible when block invisible
Steps to reproduce:
 1. Go to the website
 2. Add website languages
 3. Drag Table Of Content
 4. Select snippet block
 5. Go to customize the block
 6. Select visibility conditionally - set visible/hide for languages.

Before the commit, selecting block visibility conditionally makes only
the block is invisible but not the navbar content is invisible due to the
absence of the `data-visibility-id` attribute.

In this commit, handling conditional visibility of the navbar when the
the snippet block is invisible.
Also, This commit adds a check for missing visibility IDs in anchor
links. The code checks if both the visibility ID values exist or if they
are both missing. If either condition is met, the function returns
without creating the `<a>` tag.

task-3373943

closes odoo/odoo#137081

X-original-commit: 182d3f20d8d3ae8149280ac3084423ba11e0975d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-29 11:59:06 +00:00
Rodolpho Lima 69a27360c9 [IMP] web_editor: omit protocol in URL input field
Before this commit, when an existing link was edited with the LinkTools
or LinkDialog, the URL input field omitted the "mailto:" part of the URL
for email links, but displayed the protocol/scheme for http(s) links and
phone numbers (tel: or tel://).

This commit standardizes the behaviour of the referred input field such
that the protocol/scheme for http(s), mailto and tel URLs are omitted,
in order to have a cleaner UI.

task-3516854

Part-of: odoo/odoo#136487
2023-09-29 09:21:52 +00:00
Mahamadasif Ansari 3389bbafad [REM] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Ref-https://github.com/odoo/odoo/pull/130467

task-3508331

closes odoo/odoo#136920

Related: odoo/enterprise#48065
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-28 16:57:55 +00:00
Guillaume (gdi) 5297388cd2 [FIX] website: prevent traceback on sharer click
Some pages don't have an image for the sharer. This wasn't too critical,
as the code to retrieve the image was written in JQuery and didn't cause
any problems if no image existed.
```
$('meta[property="og:image"]').attr('content')
```
If there is no element matching the selector, it returns `undefined`.
[This commit] was merged and migrated the JQuery code to vanilla JS.
```
document.querySelector('meta[property="og:image"]').content
```
If there is no matching element, it throws an error (we can't read the
content on undefined).

This commit keeps the vanilla JS code but prevents the error if there is
no image to share. In addition, for this master commit, we took the
opportunity to refactor the code.

Steps to reproduce the bug as an admin:
- Go to /slides and click on "View" next to the user's name
- Edit the page
- Drop the share block on the page
- Save the page
- Click on the Pinterest share button

=> An error appears on the screen.

[This commit]: https://github.com/odoo/odoo/commit/ddb2c06be4196c86ff6a2fd74874487d75b31c94

opw-3326724

closes odoo/odoo#136737

X-original-commit: 66651fabcc36e8d5f455c08d5bffb9036bef8d3c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-28 11:56:52 +00:00
luvi b91f4034ab [IMP] *: improve documentation of options in fields metadata
*: analytic,  base_automation, loyalty, mass_mailing, project, web, web_editor, website

This commit adds many new documentation of options and their usage for
fields. This makes them more usable and customizable in Studio, and adds
documentation for developers to know the type of expected option.

Some options that might lead to issues or that are too technical have
been removed, as they are not relevant and not required in most use cases.

task-3469741

closes odoo/odoo#134858

Related: odoo/enterprise#47148
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-09-27 14:57:03 +00:00
Michael (mcm) 7422eb643c [IMP] *: remove legacy rpc
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.

closes odoo/odoo#136271

Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-27 11:33:01 +00:00
Romain Derieandqsm-odoo 5d1e9bfbad [FIX] website, *: add website_id in seo save rpc context
*: website_event

Without this, the seo saving would not forward the current website in
the context. It's especially bad in this case as it's writing on views
which are not triggering the COW due to the lack of a website_id in the
context.

Step to reproduce:
- Go to /shop (if you didn't do anything, this will be bound to the
  `website_sale.products` view which has no website_id set and is called
  a generic view)
- Open "Optimize SEO" dialog and type something in the title
- Save
- It saved the change on the mentioned view, without duplicating it
  (COW) before writing on it. The title you added is now applied to
  every websites and not only the one you edited, which is against the
  website holy grail rule: only the website you edit should be changed.

Technically, this is because we refactored that part of the code in Odoo
16: the website is now editable in the backend.

Note that this fix also revealed that a test for events (which has been
introduced with [1]) was relying on the bug: it tested the meta title of
a view that should (and will after this fix) have been COW'ed. This test
will now indirectly protects this bug from re-happening, although we
might want to write a dedicated test in the future as the behavior for
events might need some refactoring.

[1]: https://github.com/odoo/odoo/commit/2072a7739eb9a9ee87c8b3c7b0d43a82a7e2375f

opw-3499285

closes odoo/odoo#136550

X-original-commit: c45c0bf8fff7285a9fff33ff9bf1c24bbfb130e7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-09-26 13:35:42 +00:00
Rodolpho Lima a7d9c07816 [FIX] website: add missing flow to LinkTools tour
Before this commit, some actions related to link creation and edition
were not tested by the LinkTools tour.

This commit adds steps to the mentioned tour in order to avoid
regressions of the issues fixed in the referred task.

task-3284649

closes odoo/odoo#136278

X-original-commit: b2a79ed9960d88d1bdf6465389f4ef720f6bc235
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-25 11:30:13 +00:00
Alexandre Kühn c191f94b43 [IMP] website: enable livechat button in website preview
The livechat button was disabled in website preview because
its implementation could not properly handle being in an iframe
inside the backend [1].

With the public livechat code being refactored to use discuss code,
this is no longer a problem, so the livechat button can be present
again. This also makes previewing the website more correct: the
livechat button is actual present on the website, so hiding it was
a lie.

By re-enabling the livechat button, this also allow to remove the
test coverage by a tour, which was sometimes failing on runbot due
to tour being small and doing `im_livechat/init` rpc after the end
of the tour.

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

runbot-24631

closes odoo/odoo#135913

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-20 18:19:50 +00:00
Romain Derie f8bba6b9bc [FIX] website, *: add missing _lt and missing .pot entries
This commit fixes this error:
- The IMP done at [3] added a lot of fields but all of those forgot the
   `_t()`/`_lt()` translation.

Note that:
1. A fix to replace `_t` by `_lt` was done at [4] but it was badly done
   as it was not targetting the correct version... and only fixed one of
   many occurences.
2. In this forward port, using `_t()` seems to be working again, using
   `_lt()` is not required anymore. This part of the PR has been removed
   here. For tracking purpose, here was the other bug:
   - The form registry fields added in [1] and [2] in Odoo 13 had a
     `string` attribute translated with `_t()` while now it should be
     translated with `_lt()`. It was surely working in Odoo 13 but not
     anymore. It's not worth investigating to be sure.
   - Not needed since a recent commit which removed `_lt()` (it's a
     deprecated alias to `_t()` which now handles the lazy translation
     directly too.

[1]: https://github.com/odoo/odoo/pull/32565
[2]: https://github.com/odoo/enterprise/pull/4063
[3]: https://github.com/odoo/odoo/commit/617eba941785aa680edb826e14b0009637d60dee
[4]: https://github.com/odoo/odoo/commit/2be83cae7bcda369ed5bc7806aef845c6c76e687

opw-3471873

closes odoo/odoo#134238

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-20 11:34:07 +00:00
Romain Derieandstefanorigano (SRI) d0885afa62 [IMP] website: better vertical align and horizontal spacing in systray
---- Horizontal spacing issue ----

The horizontal spacing between systray items in the patched website
systray is too small. It was using the regular margin of the default
Odoo systray which is composed of almost only icons for which a small
spacing is what we need.
But the website patched systray contains a lot of text, where we want a
bigger spacing, exactly how we do for the app menus.

---- New class on systray ----

To target the website systray in scss, a new class was added on it.
There is no clean way in JS to add that class, as the website systray
patch is only altering the method in charge of returning the systray
items. The rest is left up to the base NavBar class component, including
rendering.
That NavBar component does not come with a built in way to add a class.

We could have targeted the DOM directly in the patch through
`this.root.el` and added the class in JS directly but that seems like an
owl anti pattern.

---- Vertical align issue ----

Before this commit, the btn in the systray didn't have the same line
height as other elements: both the "Edit" (in main lang) and "Translate"
(in alternate lang) buttons had a (1-2px) vertical alignment issue.

This was because, despite having the same font style and font size, they
had a different line-height making it glitch 1-2px vertically.

It's a bit less visible for the Edit button as there is a pencil icon
between this text and the text next to it.
For the translate button, it's quite visible directly.

For testing purpose, you can simply remove the icons and the left-right
margins of those systray items so the text are glued to each other and
you clearly see the misindentation.

---- Misc ----

For tracking purpose, there is multiple cases to be tested regarding
those buttons:
- Community vs Enterprise (where those are colored)
- Regular mode vs translate mode

closes odoo/odoo#135956

X-original-commit: 066e4a1ddd9faf7ba866c5428c943b5af8115191
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: "stefanorigano (SRI)" <sri@odoo.com>
2023-09-20 08:36:41 +00:00
qsm-odoo ba8c4ca17d [FIX] website: always update color previews after bundle reloads
Before this commit, updating the color previews in the editor panel was
only done if the user remained in the "Theme" tab.

This means that those steps worked:

- Add a snippet in your page
- Go to the theme "tab"
- Change a theme color: validate the color you chose by closing the
  dropdown by clicking inside the theme panel, staying in the theme tab
- Click on the snippet
- Open the background option colorpicker -> theme colors are right

But those apparently same steps did not work:

- Add a snippet in your page
- Go to the theme "tab"
- Change a theme color: validate the color you chose by indirectly
  closing the dropdown by directly clicking on the snippet you added
- Open the background option colorpicker -> theme colors are wrong

task-3419142

closes odoo/odoo#135703

X-original-commit: 83c0bd93f0948bed4220ba5e505516f305b1c6ce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-19 16:37:17 +00:00
Jinjiu Liu dfeb387b0e [FIX] website: suggest links breaks rpc
Reproduction:
1. Install website
2. Change to edit mode and edit a link on the main page, for example,
“contact us” at the bottom
3. When you replace the link with /, the rpc breaks and no suggested
links returned

Fix: this issue is gone with a recent update on master, now the rpc used
by linkTools is the new rpc

Task-3444671

[FIX] web_editor: restore double click focusing on URL when editing link
Reproduction:

1. Install website
2. Change to edit mode and edit a link on the main page, for example,
“contact us” at the bottom
3. The focus is on the url at the link tool

Fix: The desired behavior when clicking on links in editing mode is: one
click, edit the text of the link; double click, focus on the URL in link
tools. After converting to OWL, focusing on URL is handled by props, e.g
. `shouldFocusUrl`. We also need to update the state of this prop in
`toggleLinkTools` as we did before conversion.

Task-3444671

Forward-Port-Of: #132167

Also added fix for using the new rpc function instead of the legacy one,
edited the test accordingly.

Part-of: odoo/odoo#135371
2023-09-19 16:37:15 +00:00
can-odoo 402bf48fb5 [FIX] website: remove ToC snippet on removing last content
The user has the option to remove the last block from the Table of
Content snippet prior to this commit, but doing so breaks the Add Item
feature because there is no reference to adding a new item in the
snippet area, and doing so is also not a good idea.

If the block is the final one in the Table of Content after this commit,
removing the last Content will remove the ToC snippet.

task-3081442

closes odoo/odoo#135733

X-original-commit: 164db4013439042725c94f1690ae0a311be9d554
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-09-17 14:37:09 +00:00
Robin Lejeune (role) e3b3bc2978 [FIX] website: fix animations in popups without backdrop
Since the scrollbar was moved from the window to .modal-content at [1],
animations inside popups without backdrops would not be working anymore
because the scroll was not checked against the right element.

This commit fixes this by using the right scroll element's scrollTop.

task-3328419

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

closes odoo/odoo#135404

X-original-commit: 1b618b323424e29b0ddf9eae686e0ef2540b3627
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-09-15 20:34:29 +00:00
Louis (loco) 597b519c4d [FIX] *: enable to use the backslash character in a field label of form
*website

Steps to reproduce the bug:
- Drop the "Form" snippet on the website.
- Add a new field.
- Replace the field label by "test\".
- Save.
=> Traceback of type "Cannot read properties of null (reading
'dataset')" appears.

In the `start()` function of the `s_website_form` public widget, the
field names of the form are extracted thanks to the `serializeArray()`
function. The field elements are then found by doing a `querySelector()`
on the field names. In our case, the field name of the new field
extracted by `serializeArray()` is `test\\` (there are two backslashes
because the field name is a string so the first backslash has to be
escaped by a second backslash). The problem is that this string has to
be escaped one more time in order to be used in a `querySelector()`. As
it is not the case, the result of the `querySelector()` is `null`
leading to a traceback when the code tries to access its dataset. To
solve the problem, the character `\` is encoded before being stored in
the `name`, `data-name` or `data-visibility-dependency` attribute of the
field element. Thanks to the encoding, the `querySelector()` operation
can perform correctly on those attributes.

opw-3470291

closes odoo/odoo#135587

X-original-commit: 03f230a77c0d38b46944d45b4991f48e45b275dd
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-15 10:48:31 +00:00
Samuel Degueldre 239d8c0a06 [FIX] website: fix editor unable to open with filled date field
In odoo/odoo#133349 some code in website was adapted to use the new
datetime picker and luxon instead of tempusdominus and moment, but some
conversions were improperly performed causing a crash that would prevent
the website editor from opening. This commit fixes this issue and also
formats the chosen default date/datetime correctly while within the
editor.

This commit also fixes a minor issue with props validation of the
datetime picker, where we would give it an empty string instead of null
or false, causing props validation to fail in debug mode.

closes odoo/odoo#134493

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-12 17:16:18 +00:00
Soukéina Bojabza 68d89150b1 [FIX] website: fix traceback when customizing Google Map API key
Since commit [1], which converted the wysiwyg to Owl, trying to
customize the Google Map API key causes a traceback.

Steps to reproduce:
- In edit mode, go to the "Theme" tab.
- Click on the Google Map "Custom Key" button.
=> A traceback appears.

It happens because when getting the parent with the `this.getParent()`
call, the parent is now a `WysiwygAdapterComponent` component and so,
calling the `trigger_up` function on it does not work anymore.

This commit triggers the `gmap_api_key_request` event in a way that is
compatible with the Owl component.

[1]: https://github.com/odoo/odoo/commit/76d4f9811b756f0e57b0a33dbba534c900c7fe15

opw-3489976

closes odoo/odoo#135069

X-original-commit: 355a593fe2dea05a96d0491d684722770533ab7d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-11 23:59:48 +00:00
Aaron Bohy 0d7acf60b4 [REF] *: remove legacy Markup
Use owl.markup instead.

Part of task~3439226

closes odoo/odoo#134793

Related: odoo/enterprise#47124
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-11 19:13:59 +00:00
Benjamin Vray eb2162f051 [FIX] website: fix the outline hover effect
Before this commit, there was a 1 pixel border around the image that
remained visible after the "outline" hover effect mouse out animation
was triggered.

This happened due to a typo where the initial value for the "outline"
animation was set to 1 pixel instead of 0 pixels.

task-3495241

closes odoo/odoo#134975

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-11 11:53:57 +00:00
xO-Tx a907a220fc [FIX] website: fix mega menu option classes
Steps to reproduce:

- Go to website > Create a mega menu.
- Go to edit mode > Switch to narrow width for the mega menu.
- After save, the update is lost.

After the refactoring in [1], non-returned class values (in the code
that replaces `_.without()` by native JS) will prevent setting the
option class on the mega menu, leading to the behaviour described above.

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

opw-3465004

closes odoo/odoo#134901

X-original-commit: 293fce5cc5407705a4314c85fd780cff435202bc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-09-08 16:48:04 +00:00
Géry Debongnie e0fdb6a0b4 [IMP] *: rewrite module loader
This commit rewrite the module loader to simplify it and to improve error handling.
before this commit, you could have silent errors or "lucky" imports (import a module based on the fact that his asset will surely be load and if not, the error would be silent anyway).
e.g.: The tours cannot import modules extern to tours' bundle anymore. Or load module before your libs in assets.

TASK ID: 3266021

closes odoo/odoo#128502

Related: odoo/enterprise#44100
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-09-08 16:47:56 +00:00
Michael (mcm) 36061a4ab0 [IMP] web: simplify owl_compatibility
This commit tried to remove owl_compatibility completely but its last
uses are either in refactoring or a bit complex to migrate. Instead of
removing the helpers completely, this commit simplifies them a lot and
makes them more readable and safe.

closes odoo/odoo#134295

Task: 3439226
Related: odoo/enterprise#46899
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 11:12:39 +00:00
Michael (mcm) 290a9b9055 [IMP] web_editor,*: use dialog service
*: mass_mailing,website,website_sale

Before this commit, the ComponentWrapper was used to mount some
components which then render a dialog. This commit replaces these cases
by using the dialog service.

Task: 3439226
Part-of: odoo/odoo#134295
2023-09-08 11:12:39 +00:00
Arthur Detroux (ard) d8d71c5ce6 [FIX] website: fix traceback when refreshing with f5 or ctrl+r
[1] removed the `router.redirect` method but [2] which was forward
ported after from 16.0 used the redirect method where it still existed.

This causes a traceback when using f5 or ctrl+r.

This commit fixes that by using the proper method in 16.2+

[1]: https://github.com/odoo/odoo/commit/365fe390fdc814bc079419f0bd940b8edd652618
[2]: https://github.com/odoo/odoo/commit/45affc3a94f33478063d2e82be5e0c51df92fb5f

task-3458691

closes odoo/odoo#134764

X-original-commit: dec96bca556b8df23fb692587cb64b47a6a3206b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-08 09:47:08 +00:00
Aaron Bohy dc680a4429 [REF] web,*: stop using and remove legacy utils
*account,web_editor,website,website_sale,website_slides

This commit removes all legacy utils except Markup, which will be
removed in another PR. A lot of those utils were no longer used and
thus have just been removed. Those that were still used either
already existed in the wowl codebase, so usecases have been adapted
to use the new version instead. A few have been re-implemented (or
moved basically) to the wowl codebase (e.g. isEmail and humanSize).

Part of task~3439226

closes odoo/odoo#134620

Related: odoo/enterprise#47044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 08:29:58 +00:00
Lou (loha)andqsm-odoo 0d448d950c [IMP] website: generate text with a LLM for configurator pages
When building a website with the website configurator, you get pages
with a nice layout. However, the text inside is not adapted to your
company, industry or even, most of the time, language.

Using a LLM, we could easily get text much more relevant to customer
needs. The scope of this work is static pages generated with the website
configurator (homepage, about us, pricing, ...).
Later, in other tasks, we also want users to be able to generate text
inside the website builder.

This commit implement the bare minimum to generate and replace a website
content by AI generated sentences (based on the information provided by
the user).

Related IAP PR at https://github.com/odoo/iap-apps/pull/656

task-3248852

closes odoo/odoo#121021

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-09-06 22:40:22 +00:00
Arthur Detroux (ard) 9f82d4d98b [IMP] website: stay in backend on F5 or CTRL-R while in website preview
Since [1], it was no longer possible to refresh the page and stay in
the backend at the same time. This was known at the time and was an
accepted downside.

However, with this commit, a compromise has been found, if the keyboard
shortcut for a refresh (CTRL-R or F5) is used while the Website Preview
is shown (mounted), then the website preview will do its best to keep
the user inside the backend.

This will make developing features for the website modules easier, as
before, every refresh would require an extra click to return to the
backend.

To note: the debug=[mode] param would also be lost
on refreshing a website page. Starting 16.4, since [2], this would make
tracebacks harder to read as for every refresh, they would no longer
point to the source, rather just the minified file. Therefore, with
this commit, we also keep the debug mode in the URL when doing a
keyboard refresh.

[1]: https://github.com/odoo/odoo/commit/1c18b79972c3b0a97197b98390e0ba9fda703585
[2]: https://github.com/odoo/odoo/commit/59f49d6a8c856a5d8ca28dcfd7840baaa1c7672f

task-3458691

closes odoo/odoo#134444

X-original-commit: e69c6eaed4e82e08d6bbf807cf4698f6327a9cdd
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-06 21:27:00 +00:00
Guillaume (gdi) b16ab7b997 [FIX] website: allow to re-edit social media title
This commit allows you to change the title of the social media block
after the first save. If an element is in a parent that has the class
`o_not_editable` then it is only editable if it has the contenteditable
attribute set to true. We rightfully remove this attribute at saving but
without putting it back when we return to edit mode. This commit allows
to fix this case. Note that we have to improve this system in the future
(so we can get rid of this patch).

This part of the fix is very similar to [this other fix] for the team
block.

[this other fix]: https://github.com/odoo/odoo/commit/b7d53d2fcb20a447fd3098adf94ffb33bc49dda9

task-3073171

closes odoo/odoo#134281

Part-of: odoo/odoo#105964
X-original-commit: 44b0bcbdd67721e3b45567d26da00e4a3910f541
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-09-06 11:50:58 +00:00
Guillaume (gdi) 620cf19574 [FIX] website, web_editor: allow to re-edit social media icons
This commit allows you to change the icons of custom links of the social
media block after the first save. Thanks to [this other commit], there
is now a class that permits to inform the editor that a media is
editable even if it is a non-editable parent. This commit permits to use
the new class to fix the issue.

Steps to reproduce the bug:
- Drop a social media block on a page
- Add a custom social media
- Save
- Edit
- Try to change the icon of the custom social media with a double-click

=> The icon cannot be changed.

Note that [another commit] had already been made and fixed the problem
halfway (the icon change didn't work on double-click). This commit
reverts it and fixes the problem correctly with the new system.

[this other commit]: https://github.com/odoo/odoo/commit/6ead397f33512c918f51feb2b32fb3e15ffedf34
[another commit]: https://github.com/odoo/odoo/commit/bb291b35e46e42ca098aa3e04ac0b473f72be423

Fixes https://github.com/odoo/odoo/issues/104048
task-3073171

X-original-commit: b844351b9814ff2167d2183ab3216e2d1ec1d216
Part-of: odoo/odoo#134281
2023-09-06 11:50:58 +00:00
Pierre Paridans 0b8c9afb08 [IMP] website,*: removes compatibility layer for (really) old browsers
*:web_editor,portal

This commit aims at removing the need to rely on `$.browser`, which was
mainly the case to support deprecated and unsupported browsers like MS
Internet Explorer or old version of Firefox.

Doing so, this commit removes the `data-browser` attribute initialy
introduced by odoo/odoo@a7e0b73930 as not
needed anymore nowadays and to generally promote "feature detection"
instead of "user-agent sniffing" to handle browsers' feature support and
edge cases.

task-3439226

Part-of: odoo/odoo#133916
2023-09-05 19:58:08 +00:00
Benjamin Vray 7f730f81ec [IMP] web_editor, website: add an "on hover" option for animations
This commit adds an "on hover" option for animations. We've added the
"on hover" option to the animation selector. This feature is only
available for images. It allows you to pick an animation that triggers
when you hover your mouse over an image. There are six different
animations to choose from. This new animation option doesn't work with
animated shapes and devices shapes.

task-3094258

closes odoo/odoo#119197

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-05 18:44:17 +00:00
divy-odoo cea1cab535 [FIX] *: resolve the last tour step warnings
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.

This commit resolves the warnings: `ignoring action (auto) of last step`

task-3429500

closes odoo/odoo#129239

Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 15:02:47 +00:00
Samuel Degueldre 910897fc97 [REF] web, *: remove tempusdominus date(time) picker lib
As tempusdominus relies on jQuery, we have written our own date(time)
picker in owl. This commit converts the remaining uses of the
tempusdominus date(time) picker and replaces them by our own.

closes odoo/odoo#133349

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-09-04 09:19:08 +00:00
Romain Estievenart 507c368836 [IMP] *: remove jquery.ba-bbq 🍖
Task Id: 3439226

closes odoo/odoo#133763

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-01 15:09:51 +00:00
qsm-odoo caca26ed41 [FIX] website: make gray colors test more robust
Since a recent change at [1], a race condition seems to occur in the
gray colors palette test. Indeed, the change removed some delay in the
hackish code that is meant to wait for CSS reload.

Instead of restoring that otherwise-useless delay, this commit actually
fixes an extra_trigger that was incorrectly made in this test when it
was introduced at [2].

In any case, we should develop a more consistent and uniformed way to
wait for a CSS reload during edition test tours. It is currently done
different ways in different tests.

Note: this targets 16.0 to fix the wrong extra_trigger at the source,
even though [1] was only made in later versions.

[1]: https://github.com/odoo/odoo/commit/c6f8f781150902f585e16087f4a3868a855f3bd8#diff-795af7752739f5f510f74e5ee9b5b04d18a851062a1a6b7350cbe406e30a409dL18
[2]: https://github.com/odoo/odoo/commit/ddf2e74b4cf503ba651174bc7f280bf2f31a215e

runbot-24371

closes odoo/odoo#133889

X-original-commit: 6f32c27d52f877bde18628eb06475f56bdd95432
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-01 13:21:05 +00:00