This commit converts the Website Dashboard to OWL.
The main goal of the Website Dashboard is to display the Plausible
Dashboard inside an iframe. Most of the code from the legacy widget was
actually used by website_sale and not website. Since Website Sale
dashboard is to be re-done in the dashboard app (by task-3222991), a lot
of the logic could be removed and simplified.
task-3164163
closesodoo/odoo#112819
Related: odoo/enterprise#44087
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Prepare for OWL conversion while keeping the template's history, as
some of its code can be re-used in the new OWL Component.
task-3164163
Part-of: odoo/odoo#112819
Colors of headings are inherited between levels. (E.g. if no color is
defined for `<h4>`, it uses the color of `<h3>`)
This commit changes it so that all levels only inherit from `<h1>`.
task-3140991
closesodoo/odoo#111621
Related: odoo/design-themes#633
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when a heading font was selected, it was not
possible to deselect it (so that the H1 font gets applied again).
After this commit, the font selector has an extra "Reset" button to
restore the default state if it has a specified value.
task-3140991
Part-of: odoo/odoo#111621
Before this commit, customizing the theme option's background image or a
theme option's button style required several RPCs and refreshes of the
assets bundle.
After this commit those options are updated through a single RPC call
and a single refresh of the assets bundle.
task-3140991
Part-of: odoo/odoo#111621
This commit reorganizes the theme options to make them easier to find.
It also adds the following options:
- 'Font size' for each of the six headings
- 'Font (family)' for each of the six headings
- 'Margins' (top & bottom) for paragraph & the 6 headings
- 'Line Height' for paragraph & the 6 headings
- Harmonize buttons options with the custom button ones
task-3140991
Part-of: odoo/odoo#111621
Steps to reproduce the bugs:
- Add a banner on the homepage
- Click on the "create a link to target this section" button.
- Edit the anchor name to "bannerAnchor".
- Drop the image-text snippet.
- Double click on the button inside the snippet.
- Choose the homepage as the URL ("/")
- Open the "Page Anchor" select, choose "#bannerAnchor"
- Validate the changes.
- Double Click on the snippet button again.
- First bug: The URL properly shows "/#bannerAnchor" but the page anchor
select does not show anything.
- Open the page anchor select again.
- Second Bug: the "bannerAnchor" option does not appear as a choice.
This commit fixes the two bugs described above.
task-3378864
closesodoo/odoo#128345
X-original-commit: 62ed601bcf53fd6572118e742a5e27f7f3c7b6f6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
When user creates a new 'livechat channel' in website, and click on
'Optimize SEO' a traceback will appear.
Step to reproduce:
- Install 'website' and 'im_livechat' module
- Go to 'website' module
- Click on 'NEW' and then create a new 'Livechat Widget'
- Go to 'Site' and click on 'Optimize SEO'
Error: A traceback appears: Invalid field 'website_meta_title' on model
'im_livechat.channel'
The menu should not be shown for such model which do not inherit the
SEO mixin. This commit ensures that.
sentry-4241511888
closesodoo/odoo#128187
X-original-commit: b2bcf950bd62872fe5dc9455636256d9213b58dc
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
__Description of the issue:__
- The `replace` method in JS only replace the first occurrence of a
string (unless `g` flag is used in the regex)
- There could be an apostrophe (`‘`) in a string value which would be
replaced by a quote (`“`)
- There could be “None”, “False” in a string value which would be
replaced too
- “True” is not taken into account
__Description of the fix:__
Those regex are meant to deal with more edge cases when transforming a
python dict to a JSON in JS. However there are still ways it could go
wrong. For the forward port in master, it could be a good idea to
consider converting dictionnaries directly in the backend using the
`json` python library.
__Steps to reproduce the issue:__
1. Edit the view `website.contactus`
(If `website_crm` is installed, either uninstall it or disable the
`website_crm.contactus_form` view)
2. At line 5, change the attribute `t-att-data-values` to a more
complicated dict like:
```
"{'email_to': res_company.email, 'name': 'Alice True', 'age': None, 'active': True, 'attr1': None , 'attr2': False , 'attr3': 'let\'s go'}"
```
3. Go to `/contactus` on the website
↳ Traceback
opw-3328690
task-3340946
closesodoo/odoo#128127
X-original-commit: 5360e10dcd89bdbae6d01a0f6597571c8592301f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Steps to reproduce the bug:
- Drag and drop an Image Gallery Snippet onto the page.
- Add an image in the Gallery.
- Click on the "right" arrows.
- The arrow is gone.
A bug similar to this one had already been fixed by the commit [1] that
added the "o_not_editable" class to the "carousel-control" elements of
the "s_image_gallery" snippet. However, it was also necessary to make
this change in the QWeb template used when the slideshow is regenerated
upon adding an image.
[1]: https://github.com/odoo/odoo/commit/ef7adab23b310001ea8f7ff8cd304b11a5464c7d
task-3414584
closesodoo/odoo#128133
X-original-commit: 0983553f4df2b027290082c03142db4bfb5f288c
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Before this commit, when the user was clicking on a link to another page
of the website, it was opening in another tab but in frontend mode.
However, in most cases the user actually wanted it to open in backend
mode.
Here is an example of users who started an eCommerce trial. They are
editing their homepage and want to create a product. They open the
"/shop" page using popover but because they are in the frontend, they
don't see the "+NEW" button. This behaviour seems a little odd.
Therefore, this commit aims to open internal links in the edit(backend)
mode instead of the frontend mode.
task-3177126
closesodoo/odoo#128114
X-original-commit: f7dacce18bf44914972da292ff041505289d1e16
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Since the edited website pages are inside an iframe, the options panel
cannot base its display on the CSS rules of the page. When changing the
theme colors, only the edited page's CSS is reloaded, not the option
one. Because of this, the background shapes are displayed using an
obsolete color palette inside the options panel.
This causes colors to be forced on background shapes within the iframe
because their default colors do not match the ones inside the options
panel when different theme colors are set. Once forced, the colors of
the background shapes within the content do not follow the theme
palette changes anymore.
This commit forces the background shapes displayed in the options panel
to use the current palette.
This is done by recovering the current edited page's shape background
images from the CSS rules. This approach was chosen as opposed to
adding a `d-none` version of the shape `div` to the edited page and
getting the background image from its computed style.
This fixes the color comparison between the background shapes of the
content and the ones of the options panel, thus not forcing colors if
the theme colors are used.
Steps to reproduce:
- Edit a website page.
- Drop a "Banner" block.
- Enable background shapes.
- Go to the theme tab.
- Select a different theme color palette.
- Select the "Banner" block.
- Open the "Shape" option's menu.
=> The shapes were displayed with the old color palette and if selected
were applied with the old color palette.
Additionally, to avoid a race condition when leaving a theme color
picker by either clicking on the BLOCKS tab or re-selecting the
snippet with a shape, a re-rendering of the existing snippet editors
is requested and the shape cache is invalidated if the palette has
changed in the meantime.
task-3370939
closesodoo/odoo#127951
X-original-commit: c511e100cad2febc0ebb9ce61b5eb52232e60f7d
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Since [this commit], we have a range input to select a price filter for
products. This input displays a min and max price that the visitor can
select. The problem is that the price is not formatted according to the
visitor locale. This commit fixes this issue.
Steps to reproduce the bug:
- With English as language, go to the shop page
- Go to Customize and activate filter by price
- Install French on the website
- Visit /shop in French
=> The price is not formatted according to the French locale. For
example, we can see a price of a thousand euros displayed as 1,000.00
but in French, it should be displayed as 1 000,00.
[this commit]: https://github.com/odoo/odoo/commit/41f7c7bc6428050d4c7956edca26b7c1bd2d8e04
task-3414455
closesodoo/odoo#127881
X-original-commit: 683b7edf0ce1f098757aa1e38ee6dc5d4e255272
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit introduces a new feature to the popup snippet.
Up until now, the popup could be displayed after a delay or on exit.
This commit enables the popup to be displayed on click.
To make use of this feature, the user will need to:
- Set the "Display" option of the popup to "On Click (via link)".
- Paste the anchor that has been copied to the clipboard into the
URL input of any link.
This commit also adds a test for this new feature.
task-2172312
closesodoo/odoo#76442
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- Go to website > drop a snippet with text content.
- Select a text > click on text animation button to activate the option.
- Click on the button to disable text animation > The text animation
cannot be applied again on the text.
Starting from 16.0 (exactly [1]), the `document` > `selectionchange`
event listener was added on `this.$body[0]`, which means the code from
`__onSelectionChange` will never be executed, and as a consequence, the
option will handle the text as if it has already an animation because
of the not correctly updated value in `this.$currentAnimatedText`.
Spotted while working on [2].
[1]: https://github.com/odoo/odoo/commit/3c2febddb67888617dad74af0e9e46ed60d105b7#diff-d2188391a9d83cc97f3220e08d259e82796d94191dcf5e5fdb9b77e57074e6a5
[2]: https://github.com/odoo/odoo/pull/122751
task-3414256
closesodoo/odoo#127812
X-original-commit: 1bf244c77f4bd1f52c0964b75e0ce5582bfa54f7
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
When an HTML field is empty and no block can be dropped inside it, it
is very difficult to locate or even notice.
This commit adds a placeholder text inside sanitized HTML fields.
Steps to reproduce:
- Install website_crm_partner_assign.
- Go to a contact without website description.
- Go to its website page.
- Edit page.
=> The `partner.website_description` field is difficult to locate.
task-3293600
closesodoo/odoo#120588
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
The website frontend apps menu list is not working when the user has a
`Home Action` defined on his user.
The `Home Action` is meant to redirect to the defined action whenever
that user is login in.
But since the backend menu links on the website have most of the time
no `action` defined but just a `menu_id` defined, the `Home Action` will
kick in and take over the redirection, the same way as if the user just
type `/web` without any params.
To solve that, we simply force the `action` of those links (if they
don't already have one).
This will make sure that the redirect is working as it should for users
having a `Home Action` set.
Step to reproduce:
- Set a Home Action for any user, like "Contacts"
- Go to the website frontend, eg on `/`.
- Click on the top left button to show the backend app menus list
- Click on any menu (CRM, Invoicing, Calendar..)
-> Most of those menu will not redirect you were you are supposed to be
but on your Home Action instead.
You can figure which one will be buggy or not by just mouseovering
the link and see if the URL param `action` is set to something or
not.
--- Technical hints ---
There is multiple methods to get the list of menus in Odoo:
- `load_web_menus`: called by the web client rpc, calling `load_menus`.
If a top/app menu has no action defined on it, it sets the first found
action of their children menus to it.
It returns the full (flat) list of menus, not only the top/app ones.
This method is not ormcached but is calling an ormcached method and
just doing some tiny work on the data.
- `load_menus_root`: called only by website backend template to add the
app list on the website (in the frontend) to jump to the backend.
It does not force the action if a menu has no action set on it.
It returns only the top/app menus.
This method is ormcached.
Note that this method seems only used by the website module.
- `load_menus`: returns the full (flat) list of menus without a force
action
This method is ormcached.
Fixes https://github.com/odoo/odoo/issues/119971
task-3378963
closesodoo/odoo#127840
X-original-commit: f28a349aa40b2ea48ef8f2b71e806b965777014f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Prior to this commit, the translate button was in uppercase.
To maintain consistency with other buttons, this commit changes the
button to lowercase.
task-3414983
Part of task-3326263
closesodoo/odoo#127828
X-original-commit: 52f0bf2f2581b77a32d5e92fe1ae03d9787db5b4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
If user tries to publish or unpublish the forum post from forum posts list view,
a traceback will appear.
Steps to reproduce the issue:
- Install website_forum
- Configure website
- Go to Website -> site -> Forum Posts
- Select any post -> Action -> 'Publish' or 'Unpublish'
Error: A traceback appears:
"ValueError: Invalid field 'is_published' on model 'forum.post'"
https://github.com/odoo/odoo/blob/551685368971161975d64f480e9bec326db8931e/
addons/website/static/src/components/views/page_list.js#L69
Here we will receive 'forum.post' in this.props.resModel.
is_published field is not present in the 'forum.post' model,
So it will lead to above traceback.
sentry-4256037237
closesodoo/odoo#127476
X-original-commit: 16943c482c9ba8e12eab697ceb48a3ef6ee6c2fb
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Renilkumar Kajavadra (reka) <reka@odoo.com>
The unsplash beacon public widget is started before the test assets JS
is loaded. Because of this, the approach in [1] fails sporadically.
If the result from the `/web_unsplash/get_app_id` RPC is obtained
before the test assets JS is loaded, the beacon patch is not applied
in time, and the test fails.
This commit applies the patch within the actual page HTML to avoid this
issue.
[1]: https://github.com/odoo/odoo/commit/a5abc766424f34074be3ae7a97ad7c6e9583f9c5
runbot-22610
closesodoo/odoo#127809
X-original-commit: 3f64135ff136addfad7c4c79e8c19cc33f8b19cf
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Since [1] the page manager tour test fails from time to time because it
manages to click on the Delete Page popup's OK button before it is
enabled.
This commit makes sure it only clicks on the button once it is enabled.
This commit also includes the master version cleanup of [1].
[1]: https://github.com/odoo/odoo/commit/a65d8811119f4d1a044be3e140fd0c27ad1cf823
runbot-20823
runbot-23032
closesodoo/odoo#127614
X-original-commit: 668fc8fa6f56b8eda9c81300a818da2559c0d0dd
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Steps to reproduce the bug:
- Drag and drop a Carousel snippet onto the homepage.
- Add an image inside a Carousel slide.
- Set the "Content width" option of the slide to "Full".
- Set the "Layout" option of the slide to "Grid".
- Make sure the image touches the edge of the page.
- Bug: The arrows are below the image and are no longer accessible.
To fix this bug, we add 'isolation: isolate;' on the Carousel content to
create a new stacking context. This ensures that elements like
indicators and arrows will always appear on top of the carousel content.
task-3383061
closesodoo/odoo#127491
X-original-commit: 99133cafbb0cb0aa9563475eb364dfffc412d2fe
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the "click on save" in french step was checking for
the element containing the "Save" french translation term, which is
coming from Transifex.
It sometimes changes, making the tour fail.
It was "Sauver", then "Sauvegarder" and now "Enregistrer".
This was a well known issue as we already made a quick and dirty fix for
that with [1].
It was judged enough as we did not want to spend more time on this fix
as it was expected to not break anytime soon, and we needed a quick fix.
The chance is now taken to adapt the test to not rely anymore on the
.pot file.
We also take the chance to not use an existant translation but a fake
one as it will speed up the test (no need to actually read/parse .po
files are there is none for this lang).
[1]: https://github.com/odoo/odoo/commit/594ac2c9651f27cc1623fcd5b916cb191241651b
runbot-22946
runbot-22945
closesodoo/odoo#127493
X-original-commit: 6d9d4d1b43544ae98cc8037ba01c81b66ab9f0ee
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
We have a public widget that disables automatic slides on carousels when
the user is in edit mode (see `registry.slider`). Unfortunately, since
[this commit], the automatic slide of the carousel in the "Products"
block was not disabled in edit mode. This was because a
`widget_start_request` was made without specifying whether the user is
in edit mode. When it's not specify, we consider that we are not in edit
mode. As a result, the public widget no longer stopped the carousel
because it considered that it was not in edit mode. This commit fixes
this problem by correcting `widget_start_request`.
Steps to reproduce the bug fixed by this commit:
- Have an ecommerce
- Edit a page
- Drop the "Products" block
=> If you wait a few seconds, the carousel moves, even though it
shouldn't as long as you're editing your site.
[this commit]: https://github.com/odoo/odoo/commit/7af099ccf1e5892513c1b0827553fe93614f2f07
task-3356629
closesodoo/odoo#127185
X-original-commit: 4231aca9665829673e29a027469471743dab16c4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
The `PageDependencies` obtains the page dependencies from the server
during its `onWillStart`. If the parent component state changes before
the component is mounted, Owl destroys and creates a new one.
This is the case if the server response is not obtained before the
value of the URL field is modified again.
Because of this, if the user types quickly in the URL field, an RPC
is sent for each key press.
This commit obtains the dependencies in a `useEffect` that is run only
once (instead of inside the `onWillStart`), and only after the
component is mounted. It stores them in the `state` so that they are
rendered once they are obtained.
Steps to reproduce:
- Open Website > Site > This page > Properties.
- Type quickly in the URL field.
=> One RPC was sent per key press.
task-3169376
closesodoo/odoo#127125
X-original-commit: a65d8811119f4d1a044be3e140fd0c27ad1cf823
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
The issue occurred after the merge of this PR [1]. In that, we removed
the dependency on underscore.js and introduced new functions to the
qweb engine: `range` and `uniqueId`.
The variable named `uniqueId` was clashing with the qweb function
`uniqueId()` that's why variable were getting compiled as a function
instead of the actual value, which led to unexpected behaviour.
This commit renames the uniqueId variable to avoid conflicts with the
qweb function `uniqueId()`.
[1]: https://github.com/odoo/odoo/pull/123018
task-3357115
closesodoo/odoo#124659
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Steps to reproduce the bug:
- Drag and drop several snippets onto a web page in edit mode to make
the vertical scrollbar appear.
- Drag and drop a popup onto the page.
- Drag and drop snippets into the popup so that the height of the popup
exceeds the height of the viewport.
- Try to scroll the popup downwards by clicking and dragging on the
scrollbar (not using the mouse wheel).
- Bug: the page is scrolled instead of the popup.
Note: This bug occurs in Chrome (not in Firefox).
This issue occurs because two scrollbars are present at the same
location (one for the page and one for the popup) and they overlap each
other. Normally, Bootstrap removes the scrollbar from the body when a
modal is opened, and this behavior was adapted for the #wrapwrap element
with this commit [1]. However, when transitioning to Bootstrap 5, the
code that overrides Bootstrap was removed instead of being adapted (this
was done in this commit [2]).
In later commits [3] and [4], we continued to remove code that updated
the scrollbar based on the opening of a modal because this code was
causing errors due to the fact that it was incomplete without the part
removed by commit [2].
This commit restores the original behavior (before the deletions made by
the aforementioned commits) by restoring the missing code and properly
adapting it to Bootstrap 5.
[1]: https://github.com/odoo/odoo/commit/9cf8b97fe40444b44ebb6e6fb992bc658a087d32
[2]: https://github.com/odoo/odoo/commit/0b94da214b7017e8580e671cbaa68ade6de2fbc7
[3]: https://github.com/odoo/odoo/commit/cb7cf77ed080e86f800af61c9a3dc4ad36ad6cfb
[4]: https://github.com/odoo/odoo/commit/51939d09f84579f61f1ff77aacd754beba036dc2
task-3102275
closesodoo/odoo#126709
X-original-commit: 0e75f1c01ca4fcc3eb483a7256bcf72b2bca39c3
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
1. Introduce primary variable to simplified overridden value of
`$min-contrast-ratio` and document its need.
2. Reduce `$min-contrast-ratio` to 2.9 to solve the inconsistency with
the previous version 15.0 of text color over some background color.
Of course it won't restore everything to the way it was: we still
want the version 16.0 to be an evolution over version 15.0 using what
bootstrap recommended to compare contrasts. But as going from 3.0 to
2.9 should not impact existing websites too much and solve use cases
we feel need solving, we feel it is an ok change.
3. Restore override of the `color-contrast` method that will now
handle the transparent colors. Before this commit, a color-contrast
function was just considering RGB value only, after this commit it
will consider RGBA value, relying (by default) on the fact the body
background is the background behind the colors we are comparing.
task-3241031
closesodoo/odoo#126759
X-original-commit: 313220ed4a0ff4ae26eb113a3a88b0dc44b649fe
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
Steps to reproduce the bug:
- Drop the image-text snippet on the homepage.
- Double click on the button inside the snippet.
- Choose the homepage as the URL ("/").
- Open the "Page Anchor" selector and click on "#top".
- Bug: the select does not close itself after selection.
This bug occurred because there are two instances of Bootstrap on the
same element (the link anchor dropdown): the "bs.dropdown" instance and
the "bs.tooltip" instance. The tooltip instance was added by this commit
[1], probably unintentionally during a copy-paste operation.
Additionally, the text of the Tooltip was not correct ("Link size").
Having these two instances on the same element caused an error because,
since this commit [2], we check that an element doesn't have only one
instance. If multiple instances are found, the others are disabled. This
check was the reason why the "bs.dropdown" instance stopped working.
Note that we could have kept the Tooltip by moving it to the
"we-toggler" element. However, we removed it because it didn't provide
any additional value, the text of the label itself is sufficient.
[1]: https://github.com/odoo/odoo/commit/740168ce8d27da3d6a7156d2d79655a898394923
[2]: https://github.com/odoo/odoo/commit/c48f57ea2538ad51e00ac27d58f8e191781444f3
task-3378864
closesodoo/odoo#126715
X-original-commit: 6367129caf2c5d4e59ba7db0fe47047be0cb6caf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Form fields can be prefilled since [1] and their visibility
conditionally linked to other fields since [2].
1. This commit ensures prepopulated fields trigger the conditional
visibility mechanism (A), including when said field is first hidden,
then conditionally displayed (B).
2. Until [3], with a chain of visibility conditions, when one of them
was "contains", "does not contain" or a date-related condition, a
traceback was raised (C). This commit corrects the fix from [3] to
prevent this behavior now that the reason has been identified.
3. Tests are also set up to enforce these fixes.
Steps to reproduce (A):
- Drop a form
- Make field A depend on field B being set
- Have field B be autopopulated from user mail
- Save and check the form: A won't be shown despite B being set
- Removing one letter or typing anything in the input B will trigger
the visibility of A.
- Expected result: B should immediately appear.
Steps to reproduce (B):
- Drop a form
- Make field A depend on field B being set
- Have field B be autopopulated and depend on field C being set
- Field C is empty by default
- Save: only field C is shown. Type a letter: field B appears, but not
field A.
- Expected result: both should appear.
Note: this bug only occurs when field A is before field B.
Steps to reproduce (C) (until [3]):
- Drop a form
- Field A depends on B containing "abc"
- Field B depends on C being set
- Save and type something in C: there is a traceback.
task-3335536
[1]: https://github.com/odoo/odoo/commit/54873d2
[2]: https://github.com/odoo/odoo/commit/2dcbfec
[3]: https://github.com/odoo/odoo/commit/2714469closesodoo/odoo#126634
X-original-commit: 074dbb6842de1092af2abe51e6da0433ff38a96e
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
For each form action, existing fields can be defined. These existing
fields are references to objects in the ORM. It is possible to put a
domain on the field in order to filter the elements you want. For
example, the "Create an opportunity" action has a "Salesperson" field
that refers to users. This field filters the external users of the
company in order to have only the internal users. Unfortunately,
although this domain is present, it was not taken into account when
displaying the values for the field. This commit fixes this problem and
takes into account the defined domain.
Steps to reproduce the bug fixed by this commit:
- Have the website_crm module installed
- Put a form on a page of the website
- Set the form action to "Create an Opportunity"
- Add a new field
- Set the field type to "Salesperson"
=> The list of users displayed contains external users of the company.
task-3095745
closesodoo/odoo#121903
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This commit ensures that the unsplash beacon calls home when an unsplash
image appears on a page.
To achieve this it patches the RPC call when the test URL contains the
test name as parameter. The patch cancels the actual beacon call to
avoid polluting data during the test, but marks the image as having had
its beacon message sent. The test then simply checks if this marker
appears on the image.
task-3360109
closesodoo/odoo#126522
X-original-commit: 1b0f25130b461e7b531548363c680200c7363e7f
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Website configurator 'website/configurator/4', Pages and Features description
takes up more than one line owing to the larger 'font-size' of the h4 class.
With this PR, use heading size `small` instead of `h4` so that description
remains in a single line.
task-3326543
closesodoo/odoo#121743
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Users are not supposed to be able to change the field type for fields
that are required by the model. This commit removes the option to change
the field type for fields required by the model.
Steps to reproduce the bug fixed by this commit:
- Put a form on the page of a website
- Set the form action to "Send an E-mail".
- Click on the "Your Email" field
=> The user can change the type for this field. We don't want this
because this field is linked to the `email_from` field in the
`mail.mail` model. This commit fixes this issues for every model
required fields.
task-3302433
Part-of: odoo/odoo#120874
When a user puts a form on his site, depending on the action of it, some
fields of the form become necessary. These fields cannot be deleted.
Unfortunately, some users do not understand this. This commit helps
users understand that these fields are required for the action by adding
an alert in the required fields options and by improving the tooltip
displayed when the delete button is hovered.
task-3302433
Part-of: odoo/odoo#120874
*: web_editor, website
The goal of this commit is to add the reorder option on the carousel
slides. Because the option is now shared between the "Carousel", the
"Image Gallery" and the "Images Wall" snippets, a common super option
(`GalleryHandler`) has been created to handle this reordering.
task-2930786
closesodoo/odoo#117369
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Steps to reproduce:
- Add a form.
- Setup a conditional visibility on one field, using the "contains" or
"does not contain" operator.
- Save.
- Open the HTML editor and voluntarily break the form by changing the
"data-visibility-dependency" attribute to a random text (non existing
field used as a dependency).
- Save => Crash on page load.
One customer apparently reached that case of receiving a `null` value
(actually possible when retrieving a form data which is an unchecked
checkbox for example) but combined with an operator which really
requires the received value to be a string... but not sure how this is
possible. In any case, it should not make the form crash: it's just a
problematic *visibility* dependency, it should not prevent using the
form. For now, let's prevent this case to crash and add an error in the
console so we may investigate the issue if it ever shows up in a test.
opw-3243345
closesodoo/odoo#125981
X-original-commit: 27144695ff4cd5fc026332c324cfdf8498d5ef14
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Since [1] an error is raised when switching the Mode of an Images Wall
from Float to Grid or Masonry while an image is selected.
The display of the size of the image is being updated while its option
panel is not there anymore.
This commit prevents this error from happening by setting up the grid
layout with clones of the images instead of the images themselves.
This leads to the construction of a new editor for the new image.
Steps to reproduce:
- Drop an Images Wall snippet.
- Switch Mode to Float.
- Select an image.
- Switch Mode to Grid.
=> Traceback.
[1]: https://github.com/odoo/odoo/commit/2cbb691a84ce186ddd34a2a4c76d95671ed6e834
task-2990053
closesodoo/odoo#125436
X-original-commit: c532bc6c3b861a68e8381f39efaa22201ae253cb
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Prior to this commit, when using the "Slide Hover" reveal effect on the
footer, Safari would glitch it scrolls and could result in unreadable
content.
This commit fixes this by a weird hack that seems to work. Adding an
element with a background-image and a background-attachment set to
fixed seems to resolve the issue.
task-3302302
closesodoo/odoo#125346
X-original-commit: 5766aefcd354e89094c8e650b29529301e39d49d
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
`_lt` must be used instead of `_t` for `gettext`s that are called when
the file is loaded.
closesodoo/odoo#125695
X-original-commit: 1cde6dc66c3337fa8e6c18156340f18fdab1dd84
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Due to a change between Chrome 101 and 114, the CSS Custom Property
containing custom string are now always serialized using the type of
quotes used in their declaration (ie. single quotes will be kept ;
double quotes also) which wasn't the case in previous versions of Chrome
(and still not the case in WebKitGTK 2.40.0 at least).
This doesn't impact the value itself but only comparison between the
computed value and an arbitrary one (like we do in the design-themes
test).
This commit fixes it by removing the single/double quotes in the
`assertCssVariable` test helper.
The impacted precondition was introduced in odoo/odoo@b29e17765f and
odoo/design-themes@8b377af3a7 .
closesodoo/odoo#125500
X-original-commit: 82074846c429dd6abad5734680ca3e7923668bb9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows
In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.
This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.
This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.
In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.
closesodoo/odoo#125284
X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
*: web_editor, website
Steps to reproduce the bug:
- Add a Cover snippet on the website.
- Put a "Blur" filter on the background image.
- Save.
- Change the parallax from "Fixed" to "None".
- Save and edit.
=> The "Filter" option displays "None" but should display "Blur".
When changing the parallax, `setTarget()` is called. The goal of this
function is to transfer the `background-image` from the old target to
the new one. The commit modifies this function by adding the transfer of
the dataset information relative to the background image from the old
target to the new one. It also transfers the `o_modified_image_to_save`
class from the old target to the new one if needed.
Upgrade PR: https://github.com/odoo/upgrade/pull/4767
task-3287330
closesodoo/odoo#123873
X-original-commit: c82d01f7532b5b120bedfbc40bf8f2f07d750ed6
Related: odoo/upgrade#4767
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
*: website
Commit [1] (and [2]) from the "website in backend" refactoring adapted
the colorpalette to read color information on the right document (as
the right document could now be the one of an iframe which is inside the
editor environment). Unfortunately, it did not do that correctly, making
an inconsistent API relying on the fact the colorpalette should receive
an "editable" param... while a jQuery version "$editable" param of the
same thing already existed. Doing so, it forgot to give that important
"editable" param in two cases:
- For editor toolbar colorpickers (text foreground/background edition)
- For colorpickers inside another UserValueWidget (like we-multi).
This commit solves the inconsistency by removing the need of that
"editable" params and relying on the previously existing "$editable". In
the future, this should be refactored anyway.
Steps to see the issue (A):
- Enter edit mode of one of your website page
- Select some text
- Hit the "reset" (trash button) of the text background colorpicker
=> The text becomes black for no apparent reason.
Steps to see the issue (B):
- Enter edit mode of one of your website page
- Choose a new main color for your website via the theme tab
- Select some text
- Open the colorpicker for the foreground color
- Go to the solid tab and input explicitly the main color of the website
=> The color is hardcoded on the selected text instead of using the
text-o-color-1 class.
=> A test has been added to check this usecase. Making a test for (A)
is less robust as it also requires the backend color names not being
the same as the frontend ones to have the bug (otherwise it works by
chance)... and that will be solved by the next commit of this PR
(another test will be added by that commit too) **.
Note:
- After this commit, following (A), a bug remains: the text receives a
strange padding (as a "inherit" background is actually applied).
Another PR will be made to solve that (see task for more info).
- ** After this commit, (A) done in backend HTML fields instead of a
website page leads to the same bug still. This is because of another
problem that the following commit of this PR will solve.
[1]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6
[2]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af
task-3237693
X-original-commit: a30206606423af9e6c8e0313c74fd6200247437e
Part-of: odoo/odoo#125131
Steps to reproduce the bug (in 16.0):
- Create a hoverable mega menu
- Drop inline Search snippet inside the menu
- Search for something.
- Hover on the search result and move the cursor outside of the search result.
=> Result Error.
Since [1], is having a fix to the overflows of the page. In that fix
we are triggering hide(), and show() events on a 'dropdown-toggle' element
without checking whether the element is exist in the target or not.
this commit will make sure that element should be present in the target
before triggering the event.
[1]: odoo@5846a05
closesodoo/odoo#125083
Closes: odoo#118803
X-original-commit: 4fba98dbe9a82cf0fec9080bea147f5d4d088b53
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit changes the way the we-many2one and we-many2many fields work
so that they check if the model they are attached to has a website_id
field, if so, the data loaded from the model will be that related to the
current website.
After this commit, developers can get rid of the website_id field when
they add a many2X field. The domain will be automatically computed.
task-3316278
closesodoo/odoo#124985
X-original-commit: 78cfcf3b2b3a44ee8e19084639e37277991b969a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Steps to reproduce the bug:
- Install the Website Slides module.
- Got to the /slides page.
- Click on a course.
- Click on the "Add Content" button.
- Choose "Web Page" in the modal.
- Once in edit mode, drag and drop a "Table of Content" snippet onto the
page.
- Save the page.
- Scroll the page and observe that the navbar items are updated as you
scroll.
- Click on the "Fullscreen" button.
- Bug: When scrolling the page, the navbar items are no longer updated
as you scroll.
This commit fixes the issue by detecting the scrolling element by
traversing up the ancestors from the 'table of content' snippet, instead
of using the 'getScrollingElement' function, which always returned the
'#wrapwrap' when a Website Slides page is in fullscreen.
opw-3302118
closesodoo/odoo#124935
X-original-commit: 1ac274c3cdddca3e6caf76d9b30b9efaa38bc09f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Steps to reproduce:
- Go to a website page > Add a 'Form' block.
- Go to the page (in 'edit_translations' mode) > Reload the page > The
form won't be pre-filled with default values. [1]
The page reloading with `?edit_translations=1` leads to a misleading
situation where the form block is handled as on 'edit_translations'
mode (see: `data-edit_translations="1"` on the DOM) hence the behaviour
in [1].
The goal of this commit is to prevent this inconsistency by simply
adapting the browser URL once "edit_translations" mode is activated.
closesodoo/odoo#124889
X-original-commit: 8c7d096a09fe23ac7ef9b7bf54123592c52122dd
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Since [1], navigating from the website application to another one
raises an error when using Firefox.
This commit avoids looking at the URL if the iframe is not available.
It seems that in Firefox the `pagehide` event is triggered after the
iframe is released.
Steps to reproduce:
- Use Firefox.
- Go to the Website app.
- Go to Discuss.
=> An error popup was displayed.
[1]: https://github.com/odoo/odoo/commit/eacfab230b8b6d676f378ad74a402849af83dcbb
task-3302981
opw-3349388
opw-3357461
opw-3357511
closesodoo/odoo#124940
X-original-commit: 57c3ab3058d4e2eee581f5c35a7a9e1b9ac83593
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>