Before this commit, the routing map generated and used would be the one from
the website the request is performed, instead of the one from the `fw` website
ID which will be the one we redirect the user to.
This issue was introduced with the routing map by website, be8fc2296b and is
restricted to a single case: a publisher using the website switcher, and it
won't happen on next page naviguation/refresh as the `fw` website id will be
the same as the current website's ID. Thus there won't be any routing map
mismatch.
Step to reproduce:
- Create a page on website 2, set it as homepage
- Naviguate to website 1 on '/' url
- Naviguate to website 2 on '/' url
This will raise a werkzeug error about `EndPoint not iterable`.
----- Technical analysis ------
This is the current flow:
1. `_dispatch()` is setting `website_routing` to `get_current_website()` -> 2
2. `_dispatch()` is calling `_match()`
3. `_match()` is calling `routing_map()` with key = `website_routing`, which
was set to 2 in step 1.
4. `routing_map()` is calling `_generate_routing_rules()` which generate the
rules based on `website_routing`, which was set to 2 in step 1.
5. `_dispatch()` authenticate the user by calling `_authenticate()`
6. `_dispatch()` is calling `_add_dispatch_parameter()`, where URL param `fw`
is forced in session, so `get_current_website()` now return the correct
`website_id` -> 1
The issue: in order to handle the `fw` URL parameter (step 6.), we need to
check the rights to ensure we can allow the website switch.
To check rights, user need to be authenticated (step 5.), which is done after
generating the routing map (2. & 3. & 4.).
The routing map is generated based on the current website (step 1.)
Step 6 depends of steps 5 which depends of steps 2/3/4 which depend of step 1,
but step 1 should depend of step 6, which is an impossible cycle.
closesodoo/odoo#70397
X-original-commit: 4eb26497a774e934d7e1a6be9f505400fd9e2cdb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
This commit will add the needed ESLint configurations on the JS files.
These configurations are added if the JS file uses a different
environment (serviceworker, node, etc) or if it uses a specific global
(google, ace, etc).
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Previously :
Once a user enabled the cookie bar, it prevented him from dropping
snippets in the main area of the page because the focus was on
the cookie bar. Dropping snippets there has a confusing behavior and
might make the user think the editor is broken.
Reason :
The cookie bar has an oe_structure class and takes over the body
if it's not hidden or dismissed. The oe_structure allows to drop
snippets.
Fix :
Hiding the cookie bar when user enters edit mode to avoid dropping
snippets in it by mistake.
task-2477430
closesodoo/odoo#70258
X-original-commit: 8c672662c80d0dfaeb06eedfc7136a68734fbdb3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Some feature descriptions and titles have been reworded.
A sentence has been added below the title to indicate
that choices made on this screen are not definitive.
Task ID: 2451965
closesodoo/odoo#70252
X-original-commit: 63195ba03ccc1bf40b4682fc7c9aa4a1a55f1e43
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
Previously, when toggling on background shapes, they always had the
default colours. In [1] we made it so that when you toggle on a shape on
a section, it would automatically reuse the colors of the surrounding
shapes if any.
Unfortunately, when the "implicit" colors were also the default colors,
they were still marked on the shape, and it got an explicit background
image that would no longer react to changes in the palette.
This was caused by the fact that the call to _getDefaultColors returns
an empty object when the section doesn't already have a shape-container,
this was not a problem before since we were not passing in any colors
when creating the initial shape previously, the the aforementioned
change made it so that we did.
This commit fixes the issue by creating the shape-container before
calling the method that will set the colors on the shape, this way
getDefaultColors works as expected, and the colors are not marked on the
section when they are the default ones, restoring the ability of the
shape colors to adapt to the palette
[1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c
task-2500607
closesodoo/odoo#70054
X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
A colorpicker in an option positioned above the toolbar in a snippets
menu would be hidden by the toolbar because of the toolbar's z-index.
That z-index is only needed when the editor is in a modal.
The bug this commit fixes only arises when the toolbar is in a snippets
menu.
This applies the z-index only when there is a snippets menu in the page.
To accomplish that we need the "editor_has_snippets" class that the
website module applied to the body. For the sake of harmony within Odoo,
that class is now applied by snippets.editor so that no matter the
module, if there is a snippets bar, the class is on the body of its
document.
closesodoo/odoo#69680
X-original-commit: b1aa9c6093cea918337d5600ff9b16b7dd80de23
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Add a new parser in the ace for the qweb highlight. This makes it possible
to visualize the qweb tags and the part of code.
Used in the website and in xml fields.
closesodoo/odoo#69609
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Before this commit, the top position of a modal in website was always
the height of the main menu navbar. Even if the main menu navbar was
not displayed when the user is not logged.
That bug was introduced in 6ef622772f
After this commit, the top position of a modal is the height of the
main menu navbar but only if that navbar is displayed.
task-2507949
closesodoo/odoo#69391
X-original-commit: 00ab01d05b3876c5d926e16b9a5d65ace4df7360
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
On initialization, the website configurator makes a
call to an external service (api_website) hosted on
iap-services.odoo.com to retrieve a list of industries.
This call might fail if the external service is done.
This potential failure is now correctly handled:
On '/api/website/1/configurator/industries' call
failure, the configurator is silently skipped and the
user is redirected to the view website.theme_view_kanban
closesodoo/odoo#69465
X-original-commit: 35311608197ec77bafed82505639314ca693fb19
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit fixes multiple bugs related to the new link popover edition [1].
Those bugs mostly comes from new editor integration [2] conflicts, as those
where merged almost at the same time and needed a quick fix of rebase
conflicts.
- The navbar & footer link would not load the popover link edition anymore,
as it was only targetting `#wrap`.
- Double click on links was re-introduced but it was supposed to be gone.
- Tooltip from Edit and Unlink inside the popover remained open after popover
was closed.
- Some leftover code that were not related to popover but kept during the
rebase.
[1] Commit 8fcf930a6b
[2] Commit 740168ce8dclosesodoo/odoo#69389
X-original-commit: e13966cc8e04111a9e18a344132546c6baa79fea
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
The following two points are necessary adaptations for
the correct functioning of the configurator with the
module deployed on iap-services.
- The routes of the api_website module deployed on
iap-services.odoo.com use model converters to retrieve
the industry selected by the user. The configurator
has been updated accordingly. We now use industry id
instead of industry name. Using id instead of name make
record retrieval faster and model converters handle
exception if the record doesn't exist.
- 'homepage' is now added to the requested pages by
the client. Previously, this page was added by the iap
module to the requested pages.
The following two points are changes to the configurator
route handling:
- multilang=False has been added to the route rendering
the configurator in order to avoid having the lang in
the url.
- If no step is specified in the url, the implicit step
is 1. Therefore /website/configurator/1 has been changed
to /website/configurator.
closesodoo/odoo#69370
X-original-commit: b6efa4caf6514484c254869cb2f1965d207e7c65
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
The website scroll effects using the `AnimationEffect` Odoo API were not
working anymore if custom code enforces the html element as the
scrolling element. Indeed in that case the scroll event handlers were
now attached to the html element itself while it needs to be the window
in that case.
This may be something to fix at the source (the `getScrollingElement`
method). This will be checked later.
closesodoo/odoo#69087
X-original-commit: 21650ce342d0329c5385acf1181be154abbec550
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Without this, the website selector was not working
closesodoo/odoo#68877
X-original-commit: 967132be52d259eaa89b7c0d32b8e4a116d4ad9e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The eCommerce module installation is sometimes taking over 30 seconds,
to manage the user wait a loader is now displayed during the
process.
Part of https://github.com/odoo/odoo/pull/68823
task-2446852
X-original-commit: 9a75b8cc09b3210e0a555f225ac347801b584d3a
When moving blocks up and down, the speed has been decreased by 35%, as
it was too fast for the user before.
Part of https://github.com/odoo/odoo/pull/68823
task-2446852
X-original-commit: cbbaa74fe15efd19e0614d984247995af9a64247
Icons were not centered in the share snippet.
Part of https://github.com/odoo/odoo/pull/68823
task-2446852
X-original-commit: 6b2a6b3d6730b320f673ee544b2be607a258f914
On website app installation and on new website creation a configurator is launched.
The purpose of this configurator is to generate a website that meet the user's needs.
The configurator is composed of 4 steps:
1) Business description: the user is asked to describe its need with its website purpose (dropdown), its industry (autocomplete search) and its objective (dropdown).
2) Logo and palette selection: the user must select a color palette for its website. He can also upload its logo. In this case color palettes recommendations are generated based on the logo's colors.
3) Features selection: the user select the pages and applications he needs.
4) Theme selection: three themes are recommended to the user based on its industry. This screen display a preview of these three themes.
task-id: 2451965
ENT PR: odoo/enterprise#16949
UPG PR: odoo/upgrade#2316closesodoo/odoo#67537
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
- The test was clicking on a link "too soon" in some cases (editing a
link then immediatly clicking on it while the save action is not fully
performed). Ideally, this should probably be more robust around the
save action to first edit the link synchronously then perform the
actual save in DB but this can be checked later on.
- Removed useless popover update while it was hidden.
- Make sure that two consecutive update of the popover only updates its
UI relying on the last asked data.
- Make sure the popover correctly clean what it did once destroyed
(however, it is never actually destroyed for now... to check later).
closesodoo/odoo#68686
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
*: website_form
This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.
It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.
Part of https://github.com/odoo/odoo/pull/64756
task-2439860
closesodoo/odoo#64756
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when a menu inside a dropdown was clicked, the dropdown
would close itself, making the menu impossible to be edited.
That was not really an issue as those menu could still be edited through the
menu editor dialog.
That behavior was already prevented for mega menu in order to be able to edit
them.
This commit adds the same behavior to regular dropdown menu. It is mandatory
for the following commit adding a popover on menu to edit them instead of the
dialog.
Part of https://github.com/odoo/odoo/pull/64756
task-2439860
Before this commit filter selection on the dynamic snippet did trigger
the rendering of a preview. This sometimes caused a blocking loader to
appear when the filter selection triggered the replacement of the list
of available templates.
After this commit selecting a filter does not trigger a preview
rendering anymore.
Also the condition for making the warning message appear is now about
the selected template being in the list of available templates.
https://github.com/odoo/odoo/pull/68529
Before this commit the latest posts snippet implemented the lookup for
its templates and its rendering procedure.
After this commit a new blog posts snippet is introduced which relies on
the dynamic snippet mechanisms.
task-2477207
https://github.com/odoo/odoo/pull/67334
Before this commit the recently viewed products were handled differently
from the dynamic product snippet.
After this commit the dynamic product snippet supports the functionality
of the recently viewed products snippet:
- its template used to show each product
- its filter of displayed products
- its "Add to cart" feature (with the animation)
- its "Forget" feature (only applicable when viewing recently viewed)
Also added "Accessories" and "Recently Sold With" filterings.
Several kinds of filtering can be combined.
- Products can be restricted to a given category
- Pseudo categories for all products or current category can be used
- Products can be restricted to matching names
- Products can be obtained from one of the following:
- Newest
- Latest sold: ordered by descending frequency in last 8 orders
- Latest viewed
- Accessories (of the current product)
- Recently sold with (the current product)
Accessories and recently sold with are only available in product pages.
Also, generic templates have been considered useless and the whole
mechanism allowing them has been removed (this includes the
pre-rendering mechanism for the fields specified in the filter).
task-2453416
https://github.com/odoo/odoo/pull/65554
The core website behavior is the COW (copy on write) which makes it possible to
handle multiple websites on a single database.
When you do a CRUD operation on an `ir.ui.view` in a website context, the ORM
normal behavior is bypass to perform special stuff, such as:
- Write: if the view is generic (no `website_id`), we bifurcate the write on
the specific view (same `key` but with `website_id` set). If that
view doesn't exist, we create it and fork its whole descending
hierarchy. This write behavior is known as COW.
- Create: we ensure that view is created only for the website and no other.
Basically we just add a `website_id` to that view, but it might
also be about setting the correct `inherit_id` by finding the
specific view among multiple views with the same `key`.
- Unlink: if the view is generic, we will unlink that view but also create a
copy of that view for every other websites so they remain
unmodified: this is known as COU (copy on unlink).
All those behavior aims to satisfy to the multi website holy grail:
-- Any modification in a website context should never impact another website --
Because of those uncommon behaviors, it is sometimes hard to understand or
investigate a database, as views might be copied, up to the point where there
is multiple whole view hierarchies.
This commit attempts to create an user interface to easily figure what's going
on in a database at an `ir.ui.view` level.
The mains advantages of that new `ir.ui.view` Qweb view is to:
- easily figure which views are COW'd on which website
- easily detect which views have a real `arch` modification
- easily see that `arch` change
Closes#63040
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
All theme specific color palettes have been moved into website.
It allows to access them without having to install theme modules and
this is a preparation for our website configuration screen task.
Lists of palettes have been replaced by maps with palette names as keys.
Those names are composed of the palette's original theme name ('generic'
or 'base' for palettes not specific to a theme) and of an index
(ex: 'anelusia-2'), for compatibility.
To keep compatibility with previous version we also convert old color
palettes number to color palette name, specifically for each theme.
A side effect of this change is that we got rid of all gray palettes
which existed in some themes. Those were not fitting the new possibility
of gray customization in the third panel and were not always really a
good customization of the default grays (they still were there mainly
for historical purposes). Unfortunately, this may have some side effect
for old websites which used those grays but the new gray palettes (left
to the default one) should most of the time come as an improvement of
the old ones, and they are now customizable by the user. In the future,
we may associate a perfectly-chosen default gray palette, fitting the
customization system, for each color palette.
PR: https://github.com/odoo/odoo/pull/67488
task-2451965
closesodoo/odoo#67488
Related: odoo/design-themes#455
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit displaying a map on the website required the use of
the Google Maps snippet which requires to configure an API key.
After this commit displaying a map on the website can also be done with
a simpler Maps snippet which requires no configuration.
task-2464422
closesodoo/odoo#66766
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
The purpose of this commit is to control the hue and the saturation of
the gray palette.
task-2362091
closesodoo/odoo#66428
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Without this 'XML declaration', if you have magic installed, the mime type
is image/svg instead of image/svg+xml and browser don't render it.
This commit is related to #68211 meanwhile a more generic solution (if needed).
closesodoo/odoo#68239
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
Adding the option to show/hide on mobile at snippet level + review the
UI (now a top action button).
task-2431659
closesodoo/odoo#65013
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previous default website logo of the 'website' module ('YourLogo'
image) looked like a text and not like a proper logo, so it has been
replaced by a more stylised, gray-coloured, version, as a svg.
--
task-2448746
closesodoo/odoo#68075
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, when ribbon was at the right corner of a product
card, this ribbon hid the buttons in list view.
After this commit, in list view, we place the ribbon on the left to
avoid this bug. There was no better solution to fix this in stable.
task-2466120
closesodoo/odoo#67898
X-original-commit: dcddf2125652b03bf4bff385c074fef0b2096f1d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website
When declaring a SnippetOption, it is now possible to specify if the
display of the handles overlay should be visible on the snippet element.
By default, it is set to false, and if the selected snippet element does
not have any option that require the handles to be displayed, we will
display them on the first parent element that needs the handles to be
displayed.
In the context of an image, the handles will be displayed on the parent
column, as the image does not have an option that require the handles.
Part of https://github.com/odoo/odoo/pull/66550
task-2431684
closesodoo/odoo#66550
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
From the editor, when clicking on an image there is a new refresh icon
next to the delete icon that will open the media dialog to allow for its
replacement.
Part of https://github.com/odoo/odoo/pull/66550
task-2431684
The gallery slider index was wrongly calculated when the gallery had no
active element, as the jquery method .index() will still return -1 when
no element is found.
task-2472041
closesodoo/odoo#67563
X-original-commit: 666fc3697bd7d70cfa0dd92f0a401b771196bb27
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
As the container div of the fullscreen indication stays on the page to
be displayed, it was obstructing the click events of the elements it was
displayed on. The user could not access what was on top of the screen.
The solution was to remove pointer events for that div so that it
doesn't interfere with other elements on the page.
Related to https://github.com/odoo/odoo/pull/65255closesodoo/odoo#67589
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The goal of this commit is to make the Images Wall/Gallery snippet
editable to be able to open the media dialog on "double-click"
on images.
Part of https://github.com/odoo/odoo/pull/66544
task-2326573
*: website
The goal of this commit is to improve multi image selection
(Image Wall, Gallery...) using the same layout as in selected themes
for selected images.
Part of https://github.com/odoo/odoo/pull/66544
task-2326573
Behaviour before the PR is merged :
There is no indication that the user can exit fullscreen by
pressing on escape.
Desired behaviour after PR is merged :
An indication is shown to the user after he enters fullscreen,
which disappear after a few seconds. A new widget
FullscreenIndication is available.
Part of https://github.com/odoo/odoo/pull/65255
task-2438556
closesodoo/odoo#65255
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When adding a new product, 'Product Name' is displayed
instead of 'Name', and 'Create' instead of 'Continue' for every type of
new content added.
Part of https://github.com/odoo/odoo/pull/65255
task-2438556