Commit Graph
4096 Commits
Author SHA1 Message Date
Romeo Fragomeli d8128cb881 [FIX] web,website: website filter doesn't appear anymore
Since commit [1], the custom filter for website was disabled.
This commit restores the filter and adapts it for "Milk" redesign.

Steps to reproduce:
* Open the Website app
* Select the menu "Site" -> "Pages"
* Open the "Dropdown" in the SearchBar
  => Bug there is no filter for website

[1]: odoo/odoo@caef16ee4e

closes odoo/odoo#124042

X-original-commit: 9237ca777fb9c5e9bda03c2d0dbe0deed8e1b2e5
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-06 22:54:44 +02:00
divy-odoo 2af270d76a [FIX] website_form: prevent input field type change
The translation of input "default values" is allowed only when
`type="text"`. However, email field values are translatable because of
strange behaviour:

- Go to website (Edit mode) > Add a form block.
- Select the existing email field > Change label position > The input
is transformed into a `type="text"`.

Each time a "non-custom" field is re-rendered, The `_getActiveField()`
method is obtaining field related data from the database, including its
type, which changes it back to the original value ("char").

The goal of this commit is to fix this behaviour using `_getFieldType()`
to set the right field type instead of the default one.

task-3247520

closes odoo/odoo#123819

X-original-commit: caf6183c2a46ee1843b4df902fe0a96dfe3740d0
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
2023-06-06 08:06:13 +02:00
Benoit Socias fc7fa1683c [FIX] website: ignore leading slashes when creating a page
When the name given when creating a new page starts with a slash, the
werkzeug route `/website/add/<path:path>` cannot be matched. This leads
to wrong navigation situations.

This commit removes any leading slash from the entered page name.

Steps to reproduce:
- Create a page.
- Enter "/abc" as name.

=> A 404 error page was reached.

task-3328827

X-original-commit: 7ff29b680d8552f0b4a440b3209a6a37357af21e
Part-of: odoo/odoo#123693
2023-06-05 17:51:23 +02:00
Benoit Socias 3c2ee4bb6a [FIX] website: close HTML/CSS editor when leaving website preview
When leaving the `website` application, the HTML/CSS editor keeps its
open/closed state. Because of this, when returning to the website
preview, the HTML/CSS editor is being mounted immediately if it was
left opened when leaving the `website` application.

This commit closes the HTML/CSS editor upon leaving the website
preview, or navigating to another page.

Steps to reproduce:
- Open HTML/CSS editor.
- Go to the Discuss application.
- Go to the Website application.

=> Error dialog was displayed.

task-3302981

closes odoo/odoo#123661

X-original-commit: 45fd54f15689e2a749666059f9d2b99aa80f6c88
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-05 14:50:23 +02:00
Romain Derie 755ab30619 [FIX] website: prevent traceback when iframe has no src
Commit [1] introduced an cleaning of the iframefallback on page unload,
which was removing the `autoplay` attribute of the iframe `src` URL.
It was done to prevent video/music to keep playing in the invisible
iframe.
The fix was not generic and purposely targetted the elements which we
identified as problematic.

Commit [2] then made that cleaning generic, catching all iframe.
Doing so, it was actually catching too many iframes and led to traceback
on iframe not having a set `src`.
This is the case for every database having a configured reCaptcha, among
other things.
For reCaptcha, it's because it's adding the following iframe dynamically
through their third party script:
`<iframe style="display: none;"></iframe>`

This commit ensures we only target iframe having an URL attribute being
set to something.

Step to reproduce (with reCaptcha):
- Enable and configure reCaptcha
- Go to /contactus
- Leave the iframe page, eg click on "Contactus" menu to refresh it
-> Traceback

[1]: https://github.com/odoo/odoo/commit/ad78585cd514f5ff16647572d34937c18a112529
[2]: https://github.com/odoo/odoo/commit/6be8af36726d750065972e122e8f4a0aa0f56a17

opw-3343450

closes odoo/odoo#123621

X-original-commit: 463d4ee0c8000f948463772b7c96c8d111bcbc8e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-05 14:50:13 +02:00
Pulinckx Pierre (PIPU) f2a8e6bd51 [REF] web: Remove underscore.js
Underscore.js has been removed from legacy qweb engine
and from web manifest.py
range and uniqueId functions has been added to qweb
engine to replace usages of them in xml templates.
Underscore usages has been remove from xml templates.
taskId : 3246238

closes odoo/odoo#123018

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-05 13:31:35 +02:00
tsm-odoo 20c1772d35 [REF] im_livechat, *: refactor livechat
This PR refactors the public livechat in order for it to use
owl and to rely on the discuss components as much as possible.

task-2212347

closes odoo/odoo#122834

Related: odoo/enterprise#41636
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-02 22:29:06 +02:00
Guillaume (gdi) 14d3621a93 [FIX] website: remove the gap between the mega menu and the nav bar
Since [this commit] which allows to have mega menu with transparency,
the user can see the color of the block which is positioned at the very
top of the page (behind the mega menu when it is open). Before that,
the gap was always gray.

Steps to reproduce the bug
- Have a mega menu on your site
- Put a block on top of the page
- Put a red background color on this block

=> When you open the mega menu, you can see the red color between the
mega menu and the navbar.

[this commit]: https://github.com/odoo/odoo/commit/147f99bb04f83943aaedbacb1844234288e60eaf

task-3327094

closes odoo/odoo#123312

X-original-commit: dba1dac5d0b09e999e194debcb5907affca61bd7
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
2023-06-01 19:08:57 +02:00
Benjamin Vray edc71cda9f [FIX] website: fix contradiction between visibility class and height
Before this commit, when a snippet section was hidden on mobile devices
and its height was then set to 50% or 100%, the visibility classes
remained as "d-lg-block" instead of "d-lg-flex". This inconsistency
resulted in the content not being vertically centered until the "hidden
on mobile" toggle was turned off and then back on.

Steps to reproduce the bug:
- In edit mode, drag and drop a "Text" snippet onto the page.
- Click on the "Mobile visibility" option button to hide the snippet on
mobile devices.
- Click on the "50%" button in the "Height" option of the snippet.
- Bug: The content within the "Text" snippet is not vertically centered.

This commit fixes the issue by properly updating the CSS class set by
the mobile visibility option when the "height" option is enabled.

task-3224575

closes odoo/odoo#123135

X-original-commit: 0377b035eff80baec3f78ea984e12ad1422dbf7a
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-06-01 17:55:12 +02:00
Louis (loco) 75ecaa48e6 [FIX] web_editor, *: reorder invisible elements panel at snippet move
*website

Steps to reproduce the bug:
- Add a Cover and a Picture snippet on the website.
- Change their visibility to "Conditionally".
- Change the order of the two snippets on the page either with the drag
and drop tool or with the "move up" or "move down" option.
=> Their order on the "Invisible Elements" panel has not been updated.

The problem is fixed by calling `_updateInvisibleDOM()` at the end of
`moveSnippet()` and `_onSnippetDragAndDropStop()`. Note that before this
commit, all the snippets with a conditional visibility were hidden at
the call of `_onSnippetDragAndDropStop()`. This is due to the call of
`cleanForSave()` from `_destroyEditors()`. `_onSnippetDragAndDropStop()`
has been adapted in order to, as for the "move" option, do not change
the visibility of those elements.

task-3203914

closes odoo/odoo#123027

X-original-commit: 3a023cf00812cfbbef7f3b406fbd01b74f07b7c8
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
2023-06-01 09:14:05 +02:00
Louis (loco) 0af5ffed31 [FIX] *: display the correct eye icon of the invisible elements
*web_editor, website

Steps to reproduce the bug:
- Add a Text-Image snippet.
- Change its visibility to "Conditionally".
- Save.
- Edit again.
=> The eye icon indicates that the snippet is not visible but the
snippet is displayed.

Note that [1] introduced a mechanism to solve this problem (the
`cleanForSave()` of the `ConditionalVisibility` option) but the code was
not working correctly since [2].

Let's first remember that when calling `toggleTargetVisibility()`, two
main actions are performed:
- The addition or suppression of the `data-invisible` attribute from the
dataset of an invisible element. This attribute is responsible for the
crossed or not of the eye icon in the "Invisible Elements" panel.
- The call to `onTargetHide()` or `onTargetShow()` that performs among
other things the addition or the suppression of the
`o_conditional_hidden` class on an invisible element. This class is
responsible for the visibility of the element on the page in edit mode.

This being said, here is what happened at the "Save" before this commit:
- `cleanForSave()` of `snippetEditor` is called. If the related element
has the `o_snippet_invisible` class, `toggleTargetVisibility(false)` is
called (meaning that the `o_conditional_hidden` class and the
`data-invisible` attribute are added to the element).

- `cleanForSave()` of the `ConditionalVisibility` option is called and
before [2], the `data-invisible` attribute was removed from the
corresponding element.

- At the `DOMContentLoaded`, the `o_conditional_hidden` class is removed
from all the elements that have a conditional visibility. The visibility
of those elements on the page now depends on the rule set by the user.

The goal of this commit is to restore the mechansim of the remove of the
`data-invisible` attribute from the conditionnal elements at the
`cleanForSave()`.

[1]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05df
[2]: https://github.com/odoo/odoo/commit/de3c29fab2bc5349da8a9418f9d0086d76e6f7de

task-3203914

X-original-commit: b10d6cbf78235acd170716d556578227cccfbc14
Part-of: odoo/odoo#123027
2023-06-01 09:14:04 +02:00
tsm-odoo e86c1ce94a [FIX] website: hide backend chat windows from website preview
Before [1], chat windows were not shown on the website preview.
Showing them was not intended and those chat windows overlap
with the one of the livechat.

This PR restores the previous behavior by preventing chat
windows to be shown on the website.

[1]: odoo#110188

closes odoo/odoo#123096

X-original-commit: 3e74f5c1f4ea045725edcd945276e524529ffd97
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-31 17:26:16 +02:00
Louis (loco) 9578b2bbd6 [FIX] website: enable to use quotation mark for field labels of form
Steps to reproduce the bug:
- Drop the "Form" snippet on the website.
- Add a new field.
- Replace the field label by two quotation marks (`""`).
=> Traceback appears.

Since [1], it is possible for the user to create forms whose fields can
have a conditional visibility, meaning that the field is only visible if
another field in the form meets certain conditions. Due to that, there
is a mechanism that verifies if a condition on a field should be updated
when the user modifies the label of a field. To do so, a `querySelector`
is searching for an element that has a `data-visibility-dependency` set
to the previous field name by doing a querySelector of type
`querySelectorAll('.s_website_form_field[data-visibility-dependency="${previousInputName}"]')`.
Because `previousInputName` is set to `"`, it is not considered as a
character and an error is thrown.
To resolve this problem, strings that are stored in `name`, `data-name`
and `data-visibility-dependency` are encoded: All the occurrences of `"`
are replaced by `&quot;`, all the occurrences of `'` are replaced by
`&apos;` and all the occurrences of ``` ` ``` are replaced by `&lsquo;`.

[1]: https://github.com/odoo/odoo/commit/2dcbfecf3c10687a2cd3af36335d5be70c904fce

opw-3246341

closes odoo/odoo#122782

X-original-commit: ccaf4f1e52f10308ef507059316732c02ad6e6e4
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: loco-odoo <loco@odoo.com>
2023-05-30 13:03:42 +02:00
Louis (loco) cd82c87159 [FIX] website: enable to use addCustomField function with more types
The goal of this commit is to be able to use the `addCustomField`
function with a `type` argument that is different of `checkbox`,
`radio` or `select`.

opw-3246341

X-original-commit: 34b3770ad1ee9c872acaf4f82ac3c6cf52d5d333
Part-of: odoo/odoo#122782
2023-05-30 13:03:42 +02:00
Benjamin Vray 5fd185ef85 [FIX] website: fix adding same font family twice
Steps to reproduce the bug :

- Add the same google font twice with the font family selector in the
option tab of the editor panel.
- The font will be displayed only once in the font selector menu but 2
trash icons will be added, one for the added font and one for the font
that was already there.

This commit fix this and allows now the user to add the same font twice,
but only to replace a served font by a local font. The opposite does not
make sense, but if the user really wants to replace a local font with a
served, it is always possible by deleting the locale beforehand.

In addition, this commit adds a cloud icon next to the default fonts of
the theme. Since these fonts are served by Google, it is logical to have
the cloud icon. This is consistent with the cloud icon that is present
when the user adds a font served by Google.

task-2998689

closes odoo/odoo#122652

X-original-commit: 948ff01e64e5d71d60d209d074dd6be6510fe794
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-30 13:03:28 +02:00
Antoine (anso) 8ec12c2e14 [IMP] website: unify offcanvas scss
This commit:

- Unifies the SCSS code for the off canvas filters used in
website_sale and website_crm_partner_assign

- Removes the custom width of 80% on small devices that made it
possible for the user to click outside of the `.offcanvas` to close it

- Adds a close button in the website_sale `offcanvas` as the default
`.offcanvas` width is 100% on small devices and the user needs an exit
button as he can't click outside of the canvas anymore

task-3083706

Part-of: odoo/odoo#109752
2023-05-30 10:31:43 +02:00
Benjamin Vray 3074c1c428 [FIX] website: fix map snippet saved
This commit fixes the issue of having duplicate iframes when dropping a
custom "s_map" snippet that has been saved by the user.

This issue was introduced by this commit [1].

Steps to reproduce the bug:
- Drag and drop a "s_map" snippet onto the page.
- Save this "s_map" snippet by clicking on the custom snippet "save"
button.
- Drag and drop the saved snippet onto the page.
- Observe that a duplicate iframe is created in the snippet.

This commit adds a check to verify if an iframe already exists before
adding it when dropping a "s_map" snippet.

[1]: https://github.com/odoo/odoo/commit/88194dd94182ad1bbdcb9aa8f855f30f6369d148

task-3340644

closes odoo/odoo#122739

X-original-commit: 34b8c2e0578b56b87c50c222564582ed4fa7051f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-26 21:16:31 +02:00
Chrysanthe (chgo) f062b8239e [FIX] website, hr_*: fix some squished buttons
=== ISSUE ===

With the new Milk design, we introduced `.border-radius` on buttons.
Most of the time the render looks great, but in some cases, it would break
the layout.

This is due to the fact that old design sometimes used two buttons
next to each other.

This worked fine because they did not have any radius but now it looks
like they are compressed and squished.

=== AFTER ===

This commit tracks some of these cases to improve the global render
of these buttons.

task-3329612
part of task-332626

closes odoo/odoo#122705

X-original-commit: 90c2ba3eb0bf74d675c574b13cedb90235398773
Related: odoo/enterprise#41590
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-05-26 18:41:40 +02:00
Jérémy Hennecart (jeh) da38afff6d [FIX] website(_slides): delete autoplay of all iframes in the iframefallback
Delete the autoplay for all iframes in the iframefallback.
The autoplay was causing issue where the sound of the previous video
was played on the background. Now we delete the autoplay for all iframe
directly.
This happened in media_iframe_video, youtube player and vimeo videos.
We can do this for all iframe source url directly as it impacts other
modules like website_slides or website_event_track_live.

task-3012952

closes odoo/odoo#122392

X-original-commit: 6be8af36726d750065972e122e8f4a0aa0f56a17
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Hennecart Jérémy (jeh) <jeh@odoo.com>
2023-05-25 16:29:44 +02:00
xO-Tx ad8e80c90a [FIX] website: correctly mark translatable attributes
Steps to reproduce:

- Go to a website page > Add a 'Form' block > Set an input "Placeholder"
value.
- Go to the page (in 'edit_translations' mode) > The translation of the
input "Placeholder" attribute doesn't mark the input as translated and
even after saving the translation, the input is still marked as
"to_translate".

The goal of this commit is to fix this issue by extending the same
behaviour on the translated `<select/>` options (using `.oe_translated`
class) and setting the right translation state on the input from the
linked attribute translation `<span/>`.

task-3323245

closes odoo/odoo#122011

X-original-commit: 946de52ea80e0cf5f1284cea2134c22ffda3aa5f
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-05-24 11:53:33 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Romain Derie 96a1a5e69a [FIX] website: prevent race condition on snippet_editor_panel_options
Before this commit this tour was often failing. It seems to be because
there were some requests still being executed / received after the test
was marked as successful and browser getting killed.

According to the logs, even when the tour is actually not failing, there
is still some unexpected requests going on.

With this commit, saving and waiting the edit mode to be exited will
prevent all those requests issues, as it seems like the requests done
after exiting edit mode are all awaited before marking the test as
successfull.

== Before the fix success case ==
- Tour snippet_editor_panel_options on step: 'The text toolbar should still be visible, and the text still selected. (trigger: #oe_snippets .o_we_customize_panel > #o_we_editor_toolbar_container)'
- GET /website/static/src/img/snippets_options/header_template_default.svg HTTP/1.1" 200 - 0 0.000 0.003
- [Same GET for 10 other header templates]
- test successful
- Session expired
- POST /website/theme_customize_data_get HTTP/1.1" 200 - 3 0.001 0.003
- [2 lines above x10]
- Deleting cookies and clearing local storage
- Navigating to: "about:blank"
- Navigation result: {'frameId': 'A538603CC37A4E9EBA99B8624C1CD34E', 'loaderId': '9187051DD3D9477FA4EDEB1A544D584E'}
- Waiting for frame 'A538603CC37A4E9EBA99B8624C1CD34E' to stop loading
- waiting for threads: [<Thread(odoo.service.http.request.139669352166976, started 139669352166976)>]

== Before the fix error case ==
- Tour snippet_editor_panel_options on step: 'The text toolbar should still be visible, and the text still selected. (trigger: #oe_snippets .o_we_customize_panel > #o_we_editor_toolbar_container)'
- GET /website/static/src/img/snippets_options/header_template_sidebar.svg HTTP/1.1" 200 - 0 0.000 0.004
- [Same GET for 10 other header templates]
- test successful
- GET /web/static/img/smile.svg HTTP/1.1" 200 - 0 0.000 0.001
- GET /web/static/img/spin.svg HTTP/1.1" 200 - 0 0.000 0.001
- Failed to fetch
- Asking for screenshot
- Trying to set result to failed (TypeError: Failed to fetch) but found the future settled (<Future at 0x7f8fa1a25120 state=finished returned bool>)
- Deleting cookies and clearing local storage
- Screenshot in: /data/build/tests/36222061-master-all_no_autotag/screenshots/sc_20230513_220042_739175_TestUi.png
- Navigating to: "about:blank"
- Navigation result: {'frameId': 'E1A779132E972A440E5FE892BBBC9FEC', 'loaderId': '822ACED443DB0C84F57DD4A1FF451D5B'}
- Waiting for frame 'E1A779132E972A440E5FE892BBBC9FEC' to stop loading
- waiting for threads: [<Thread(odoo.service.http.request.140254747010624, started 140254747010624)>]

== After the fix case ==
- Tour snippet_editor_panel_options on step: 'iframe body:not(.editor_enable)'
- GET /web/static/img/spin.svg HTTP/1.1" 200 - 0 0.000 0.003
- POST /website/theme_customize_data_get HTTP/1.1" 200 - 8 0.002 0.035
- [Many other POST/GET requests]
- test successful
- Deleting cookies and clearing local storage
- Navigating to: "about:blank"
- Navigation result: {'frameId': '4B87BC8A50A3FEBD7D508394DD5BDB19', 'loaderId': '7CCB3B6434B52B456A1AA470C3CFA1BF'}
- Waiting for frame '4B87BC8A50A3FEBD7D508394DD5BDB19' to stop loading
- waiting for threads: [<Thread(odoo.service.http.request.139744500471360, started 139744500471360)>]

runbot-15312

closes odoo/odoo#121795

X-original-commit: 936cc061ab20dc1fe4587b24f59dc322d0e7ad9b
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-19 14:34:48 +02:00
Xavier-Do 40367e3683 [FIX] website: increase timeout on website switch step
The generation of the assets may make this step fail randomly.
The pregenerate is not enough because this is generating assets for
website2.

This issue will be partially solved in master with this PR [1] by not
generating an asset if a close one is found in the database.

For now just increase the timeout for this test.

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

closes odoo/odoo#121777

X-original-commit: c3209aec9741cda8597525add88b0a932fb7532a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-19 13:33:18 +02:00
Benjamin Vray 0f9e4babf4 [FIX] website, website_form: fix anchor link redirects
Before this commit, links scrolling to an anchor with a special
character did not work and displayed a traceback. The issue was that to
check that the anchor is valid, we don't need to check that the anchor
is a valid url as we have been doing since these commits [1], [2]. But
we only need to check if the jQuery selector is valid to correctly
target the element to which the page must scroll.

Indeed, the anchor widget returns stuff like 'ok%C3%A9%25' when typing
'oké%' wich is not valid jQuery selector. It has to be encoded to
'#ok\\%C3\\%A9\\%25' to be valid and that's what this commit does.

We also changed the way to display a new anchor to the user in this
commit. Before, we showed the anchor unencoded in a notification and now
we show it encoded. That way, if the user copies the anchor from the
notification, it's the real anchor.

Also, this commit detect if the success URL of the redirect of a from is
the current page to perform a scroll to the anchor instead of a
redirect. To make this comparison, we needed to add the url code of the
language of the current page to the session info.

Also, before this commit, the page froze when we clicked on the "submit"
button of a form that redirected to an anchor that did not exist.

[1]: https://github.com/odoo/odoo/commit/0abfaeda96c2eaa868cc7fc5fa1926dfa90fc420
[2]: https://github.com/odoo/odoo/commit/b492bde6a121be1c15ed90ce0827fcfd72a12f5c

task-2172312

closes odoo/odoo#121656

X-original-commit: f09a3fc47b5fd088c3aa5112a0fac5f442d9c915
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-19 13:33:13 +02:00
Guillaume (gdi) 848c285f70 [FIX] website: enable animations when a cookie bar is displayed
Before this commit, when a cookie bar was displayed on a page and
elements of that page were animated (on scroll and on appearance), those
animations did not work while the cookie bar was present. This commit
fixes that and enables animations even if a cookie bar is displayed. The
problem was that we were looking to see if a modal (cookie bar, popup)
was displayed and if it was, all animations were based on the scroll
height of that modal. However, this should only be done for elements
that are in the modal. The other elements should always base their
animation on the scroll height of the page.

task-3151000

closes odoo/odoo#121543

X-original-commit: 406fc8a59a36313f382a34aaba143ab2a9845718
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Dieleman Guillaume <gdi@odoo.com>
2023-05-16 20:33:19 +02:00
Nasreddin Boulif (bon) b72be1fc95 [FIX] website[_slides]: don't autoplay videos in fallback iframe
Steps to reproduce:

  - Log in as admin
  - Install `eLearning` module
  - Create a course and add a youtube video as a lesson
  - Publish the course
  - Go to the website and click on the course
  - Enable `Editor` mode (top left corner)
  - Click on lesson to open it in fullscreen
  - Click `Back to course` button

Issue:

  Video is playing in the background.
  Same issue occure with video snippet in the website editor (by default
  video is mute but still playing in the background).

Cause:

  When editor mode is enabled, there is a fallback iframe that clone the
  content of the current page that we leave into it.

  Since the youtube video has `autoplay=1` in the URL, it will
  automatically start in the fallback iframe.

Solution:

  For regular website pages, remove the `autoplay` param from all
  media video iframes urls (targeting all `div.iframe` that have a class
  `media_iframe_video`).

  For eLearning, override the `WebsitePreview._cleanIframeFallback`
  method to remove the `autoplay` param from youtube videos URLs.

opw-3226002

closes odoo/odoo#121475

X-original-commit: ad78585cd514f5ff16647572d34937c18a112529
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-16 14:42:17 +02:00
Benjamin Vray e8ebf80909 [FIX] website: fix overflowing navbar links on mobile
This commit fixes a bug with the navbar links in the header of a website
on mobile. When the text of a link is long enough to be wider than the
screen, the text does not wrap to the next line as intended, but instead
overflows to the right outside of the screen, causing part of the text
to be hidden.

Steps to reproduce the bug:

- Edit the text of one of the menu links on a website to make it longer
than the width of the mobile screen.
- Bug: In mobile view, part of the link text is hidden.

This bug occurs with both the "default" hamburger type and the
"off-canvas" hamburger type.

opw-3233684

closes odoo/odoo#121464

X-original-commit: eae10f2e154a1b6bf9f385460b1371faf9869a3f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-05-16 14:42:11 +02:00
Brieuc-brd 1e69acd14c [FIX] website: offset on the loader in edit mode
Prior to this commit, `o_navbar` wasn't fully hidden when we were in
edit mode and created an offset at the top of the loader when we loaded
something (eg. changing the header template).

This commit fixes this issue.

task-3326604
Part of task-3326263

closes odoo/odoo#121387

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-15 16:48:28 +02:00
VAN BOSSUYT Nicolas 8a8d4e7c59 [FIX] website: reorder selectors used for switching cookie banner layout
The cookie policy banner template includes nested selectors, such as
o_cookies_bar_text_policy within o_cookies_bar_text_secondary.
The process for switching the banner layout involves copying selectors
based on the order defined in CookiesBar::selectLayout()::selectorsToKeep.
However, a bug caused o_cookies_bar_text_policy to be copied before
o_cookies_bar_text_secondary, resulting in its content being overridden
by its parent content. The fix involves reordering the selectors so that
o_cookies_bar_text_secondary is copied before o_cookies_bar_text_policy.

opw-3302511

closes odoo/odoo#121324

X-original-commit: 720ae005bce261ce3b9e32dc8ade1f1d97f1aee1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-15 15:07:32 +02:00
Arthur Detroux (ard) b093fc9204 [FIX] website: prevent traceback when redirecting to different domain
Prior to this commit, after [1], when a user is trying to visit or view
their website from a domain that is not their current website, a
traceback would appear if the redirect took too long.

This is because when redirecting, we do not set any URL as the iframe
iframe source, so it loads the `about:blank` page. When trying to push
that page into the history (done to change the name and url displayed in
the browser), the browser crashes and displays a CORS error.

On top of that, it seems some users do not understand what is happening
and feel like they are being logged out if they're not logged into their
custom domains.

This commit prevents replacing the history state if the page displayed
in the iframe is `about:blank`.

It also displays a dialog before redirecting, explaining to the user why
it is necessary.

Steps to reproduce:
- Go to website settings
- Set a domain for your website that's different from the one you are
currently using to access Odoo (Could be anything but for a realistic
setup, if accessing from localhost, use 127.0.0.1 or the other way
around, or use different 127.0.0.X ips)
- Toggle a slow network mode from your browser's dev tools
(This is to ensure the traceback appears as it does not if the network
is quick enough with its redirect)
- Go on the website app
=> A traceback appears (and disappears as the page is unloaded)

[1]: https://github.com/odoo/odoo/commit/59b96b0742fe8da31eecf896f7a6157811d49de5

opw-3250663

closes odoo/odoo#121311

X-original-commit: 15a31cbcec9f51c72abac8df69932cc1a742baef
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-15 15:07:30 +02:00
Soukéina Bojabza fdfd5042f8 [IMP] website: manage better the files uploaded in a form
Before this commit, now that multiple files can be uploaded in a form,
we could observe that the file input is not convenient to manage this
situation:

- Clicking again on the input to choose other files replaces the
previously uploaded ones, we can therefore not upload files one by one.
- A file cannot be deleted in an obvious way: we need to cancel a new
upload, as it will replace the file by nothing and therefore delete it.
- When multiple files are uploaded, only the number of files is
displayed and not their name (they are only displayed on hover).

This commit improves these behaviors:

- Clicking again on the input adds additional files instead of replacing
them (unless the number of files allowed is 1);
- The button text content is modified after the upload of files,
displaying "Add Files"/"Replace File" (if multiple/single files are
allowed) to show its role better.
- When files are uploaded, blocks containing each files name and a
cross to delete them are displayed.

In order to make these improvements, the file input is hidden and
replaced by an input of type=`button` when files are uploaded. This was
done for two reasons:
- It is not possible to modify the content of an input of type=`file`
but we can change the value of a button.
- The input did not look good with the file blocks, because it has a
text displaying file informations, which was redundant with the blocks.

task-2798576

Part-of: odoo/odoo#89055
2023-05-15 12:55:58 +02:00
Soukéina Bojabza f676463dbb [IMP] website: add options for file upload in forms (max size + number)
Currently, we can only upload one file in a form File Upload field and
this file does not have a size limit. (Note that the server can have a
limit to prevent files too large from being uploaded but the file input
itself does not have one.)

This commit adds options to the form file inputs in order to set a
maximum number of files and the maximum file size (in MB) allowed to be
uploaded in these fields. The default values are 1 file and 1 MB. Note
that the option for the number of files is not displayed for the fields
where only one file is supposed to be uploaded.

If the uploaded files do not respect these limits, the form is not sent
and a message is displayed.

task-2798576

Part-of: odoo/odoo#89055
2023-05-15 12:55:57 +02:00
Benoit Socias 2b14e3148e [IMP] website: test edition of URL in mega menu with Cards template
Edition of block links has been broken several times.

This commit adds a test that makes sure it does not happen again by
changing the URL of a card of a mega menu with the Cards template.

task-3300977

closes odoo/odoo#121362

X-original-commit: b4b5816a4acd953eb4dabfd14d2a142934dee357
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-05-15 11:41:54 +02:00
Pulinckx Pierre (PIPU) f4f0f78318 [REF] *: Replace underscore.js function by native JS
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238

closes odoo/odoo#120437

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 09:37:48 +02:00
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Damien Bouvy 7dcc42daa1 [FIX] website: adapt theme previewer to milk theme
Some layout was disabled during dev, restore it with the
corresponding change for milk.

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Damien Bouvy 1e706d3069 [IMP] web, *: milk adaptations
*: hr_holidays, stock, sale, product, web, sale, purchase, stock,
   website, survey

Adapt some custom control panels (mainly for custom reports) to the
milk controlpanel.

hr_holidays:
Move the buttons to create a new time off or a new allocation to the
"create button" slot and transform it into a dropdown (creating
allocation requests is clearly a secondary action, not a primary one)

stock:
3 lines does not fit, must be on 2 lines

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Pierre Paridans caef16ee4e [REF] web,*: ControlPanel layout
This commit brings the ControlPanel into a single line with 3 main
sections:
- buttons & breadcrumb
- layout related actions (ie. the SearchBar in multirecord view or
  ButtonBox in formView)
- navigation (pager, switch view...)

Add new search bar menu, this is a merge of the following components
into one big component display in column:
* comparison_menu
* favorite_menu
* filter_menu
* group_by_menu

Also adapt navigation hook.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brd d17743e34e [IMP] * : add missing borders
Depending on Milk, this commit adds some missing borders.

Also adapts default `border-radius` to apply milk design.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) 79f57643ce [REF] web, mail, hr, website, auth_totp, test_apikeys: top-menu design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) 2b32d1431a [IMP] web: increase base font-size to 14px
task-2818586
task-3280695

Part-of: odoo/odoo#116641
2023-05-12 22:59:11 +02:00
d3b7e1c127 [IMP] website_hr_recruitment, *: improve pages design
*: website

Old 'website_hr_recruitment' templates looked outdated, so they have
been improved in terms of usability and design, by applying the
following changes:

- Old images used in `/jobs` and `/jobs/detail/` have been replaced by
new ones, taken from the Odoo official profile in social media.

- A `Connect with us` section has been added to the right column of
`/jobs`, including a separator, links and social media icons.

- Job entries in `/jobs` now show the city of the office, its country
and its department, as shown in the filters.

- In `/jobs/*`, old header with a breadcrumb has been replaced by
the topbar seen above, including a link to previous page in the
navigation flow.

- Design in `/jobs/detail/` has been improved, including a redesign of
the `Our Product` block or the image gallery at the end of the page.

- Header in `jobs/apply/*` has been improved and includes a column with
the address of the job position.

- In `jobs/apply/*`, the design of the form group has been revamped and
also has been added a right column including a snippet with the contact
information of the recruiter tracking the job application process.

- Overall design has been improved in the `/job-thank-you` view,
including the recruiter snippet seen above.

- Job description is now editable and not truncated. Additionally, a
default job description has also been added.

- Every new job entry has now a default short description, editable.

- If there is either no available job or not any valid job after the job
search, the `No jobs available` view has also been improved.

- Illustrations with dynamic colors have been included in
`/jobs/detail` (`Our Product` block) and `/job-thank-you`.

- `boolean_toggle` widget used in `website_hr_recruitment`'s
backend, in its job entry kanban has been improved.

- Syntax has been adapted to BS5.

- Tests have also been updated to the changes in the templates.

task-2406626

Part-of: odoo/odoo#67913
Co-authored-by: Benoit Socias <bso@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-05-12 19:54:08 +02:00
Guillaume (gdi) f10e85b475 [IMP] social_media, *: add TikTok to the social networks stored in DB
*: website, website_blog, website_event

This commit adds the TikTok social network to the other social networks
stored in DB. Thus, users of the Website application will be able to
reference their TikTok page on their websites. This commit also updates
the different templates and the social media block to integrate this new
social network.

task-3235451

Part-of: odoo/odoo#116837
2023-05-11 09:36:21 +02:00
Eteil Djoumatchoua(etdj) 0d56f9963b [FIX] website: render well the price range widget in RTL languages
Steps:
- Go to website/shop (with price range widget enabled)
- Change the language to Arabic

Issue: the numbers on the price range widget are overflowing

Cause:
The element leftCounter's right style property is always set to 0px.
So when changing the direction it's always on the right as his position
is absolute.

Solution:
Built-in handle by Bootstrap with end-0

Fixes #108557
opw-3221051

closes odoo/odoo#120568

X-original-commit: 4e05d93dce31f9a829961bded855a6cb7e8de7f3
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-04 23:31:00 +02:00
Guillaume (gdi) 89af36516f [FIX] website, *: add a robust utility to enter in edit mode
*: test_website, website_blog, website_crm, website_hr_recruitment,
website_mass_mailing, website_sale, website_sale_wishlist,
website_slides

This commit creates a new util which clicks on edit and waits for the
edit mode to be started. This way, we make sure that the edit mode is
enabled before testing the next step of the test. This avoids race
conditions during tests.

This commit replaces all the uses of the old util with the new one, it
also removes the steps that are waiting for the edit mode to start.
Finally, from [this other commit], we can start a tour in edit mode. For
these tests (which have `edition: true`), it is useless to check if the
edit mode has started at the beginning of the test because this check is
already done by default. This commit removes unnecessary / duplicated
steps.

[this other commit]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35#diff-c7720501ec33f5f92c907d8bb41de50edd832a4564317073e801a6915796a6bdR278

task-3203820

closes odoo/odoo#120481

X-original-commit: https://github.com/odoo/odoo/commit/9fd5d25f59578abc9c608578a7d2e2953880b582
Related: odoo/design-themes#656
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-05-04 20:33:55 +02:00
xO-Tx c99cd92c14 [FIX] website, tools: make select options translatable
Steps to reproduce:

- Go to a website page > Add a 'Form' block > Add a new 'Selection'
field.
- Go to the page (in 'edit_translations' mode) > The selection field
options are not translatable.

The goal of this commit is to make the select options translatable
by adding an intermediate `.o_translation_select` element.

This element will handle option's text translations from the linked
`<select/>`. The final values are copied to the original element
right before save.

opw-3233360

closes odoo/odoo#120363

X-original-commit: 5ff53d7f289ec531f8369a47d02bd58252bb98a5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-03 13:57:08 +02:00
Evgeniia Kotova b521624e66 [FIX] website: correct the link for plausible documentation
Current link in settings leads to 404 error page,
changing the path to the right one
opw-3279614

closes odoo/odoo#120356

X-original-commit: beffb2fcab99439c9bf9b398e500e2437e38f9f9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-03 13:57:05 +02:00
qsm-odoo 8b9bd11e13 [FIX] website: restore wrongly upgraded countdown snippets
With the BS5 upgrade script of 16.0, countdowns' data-display may have
been converted to data-bs-display by mistake. This will fix the DOM at
page load for good measures, maybe even allowing to remove this code in
a few years as hopefully all current countdowns will have been removed
or edited (or when a proper upgrade script in a future version of Odoo
will be made, if necessary).

opw-3240041
opw-3240532
opw-3258751
opw-3272731

closes odoo/odoo#119767

X-original-commit: ce506f32e3471eea1785312d4140417eba0ce355
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-02 14:47:13 +02:00