When browsing the eCommerce part of the website, customers
should be able to filter shop products based on base sale price.
Desired behavior after PR is merged:
The filter slider can be enabled through the customize menu and it only
filters using the product's base price (for performance reason) and takes
into account currency conversions, not pricelists and discounts. It uses a
custom-built library for the range input with 2 cursors (min. price and max. price).
The slider is hidden when all products shown on the current page
(category, etc.) have the same price (or there is only one product).
A more advanced version of this implementation would enable the filtering to
take more factors into account.
task-2603014
closesodoo/odoo#74575
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: fja-odoo <fja@odoo.com>
Co-authored-by: Kamen Zhekov <kzh@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Handle text and other components readability when placed over a colored
background. Both the element and the underlying bg must use the same
color, eg [fill="#FFF"].
closesodoo/odoo#75834
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Add a button for the selection of the recommended palette. Clicking
on the generated palette to select it doesn't seem to be directly
understood by the user. This button is here to grab its attention
and avoid the confusion.
task-2602521
closesodoo/odoo#75647
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Commit [1] introduced a new "image" option instead of fixing the "img"
option which already existed. Also it created a <img> tag with a "fa-fw"
class which does not make much sense. Also, our system with data-img
actually creates a <svg> tag so that the color of the icon is the one
decided in our SCSS instead of the one hardcoded in the image and so
that there is an hover effect.
[1]: https://github.com/odoo/odoo/commit/02ccad3200187724d5f133842032981fb91f7465closesodoo/odoo#75743
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web, website
This commit redesigns the editor toolbar improving its visual appearance
and introducing substantial changes wherever it is rendered.
== "Into-sidebar" design
The grid layout has been refined, improving its components allocation.
For the sake of visual simplification, "list-type" buttons have been
unwrapped from their original dropdown. For the same reason the button
to create a new table has been removed (users will have to use the
command-bar to create a new table).
Table's options have been moved to a section "ad-hoc", visible only when
a table is selected.
== Floating design (backend only)
The toolbar is now white to match the command-bar design.
In order to simplify frontend inheritance, the floating toolbar now uses
grid layout.
== Colorpicker
The generic code necessary for each design has been moved from
'wysiwyg_snippets.scss' to 'wysiwyg.scss'.
The style is now controlled by css variables allowing to customize
critical design properties without the need of SCSS overrides.
By default the design is white(-ish) to match the floating toolbar,
while in 'wysiwyg_snippets.scss' the variables are customized to get the
typical sidebar's dark feel.
Note: despite the task main objective was just to improve/fix the
design, this aimed to simplify design inheritance and reduce the css
too. While inheritance has been improved reducing the amount of
overrides, the attempt to reduce the css partially failed (in the final
lines count must be considered that a new sidebar section has been
created).
The reason is that we currently suffer from a deep and complicated
inheritance structure for this component. The xml template uses default
bootstrap classes that are styled differently depending if loaded in a
community or enterprise environment. This approach leads to overrides
that must cover all the scenarios while further customization must be
taken in account too 'cause the toolbar can be rendered into the sidebar
with a totally different design.
A possible solution would be to detach from bootstrap directly in the
lib using custom classes names, and then @extend these classes
differently according to the current environment but probably not a good
idea as we want the toolbar to use bootstrap for in-website editors (so
they can match the theme correctly) but this has to be reviewed as well
anyway. To be checked.
Part of https://github.com/odoo/odoo/pull/73565
task-2496339
closesodoo/odoo#73565
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
In master, in the 'Theme' tab of the website editor, the button to edit
color schemes has a light bulb icon, which doesn't clearly represent what
it does.
In this commit, we replace it with a palette SVG. Since we-select
elements do not have an image option implemented, we also add one
for future usage.
task-2618494
closesodoo/odoo#75730
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
In master, the embed code snippet can only be dropped as a sibling.
In this commit, we allow dropping it as a child, by giving it the same
options as the countdown snippet.
task-2618494
Part-of: odoo/odoo#75730
Now you can specify into the dynamic_filter_template the number of record to
use for desktop, mobile, and the number of record to fetch.
Some template have only sense to be shown with 1 record e.g. a full width.
Syntax:
Add on root element one or more of these attributes:
data-number-of-elements="2" -> number of record on Desktop
data-number-of-elements-sm="2" -> number of record on Mobile
data-number-of-elements-fetch="2" -> number of record to fetch
closesodoo/odoo#75662
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Some footer and header templates, introduced in [1] were using snippet
classes without the snippet data attribute. Therefore, they were not
using the snippets versioning system.
For example, the template_footer_descriptive was using an outdated
version of the s_title snippet, when a V001 css version had already been
introduced by [2].
[1]: 34ed29cbac80180982c9acc86c1412433bb88919
[2]: f34d7f4fab
task-2212216
closesodoo/odoo#75670
X-original-commit: bc4091e3049257a4517e556d51b2ed8e06e2095e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The saas version of the client is added in each call to
website.api.odoo.com. This allows the server to return
different results based on the client's saas version
task-2602521
closesodoo/odoo#75617
X-original-commit: 6e1ae856584048912cb5eaf53c0aa027b2342b5c
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit completes [1] by further reviewing the drag and drop
technical flow order:
- The content_changed event should be triggered before starting snippets
as well as it is only useful to signal the snippet modifications made
by onBuilt.
- The undroppable snippets update which was done first could probably be
done anywhere -> best to put it at the end when everything in the DOM
is done, and it is also the last thing the user expects to be done.
Note: in the new editor the role of 'content_changed' became however
unclear and should be further reviewed. This commit fixes problems with
the old flow in master though (problems around removing items in a
snippet during its onBuilt call).
[1]: https://github.com/odoo/odoo/commit/60d7bf6d7daea83db9332b4fc47a4ac6892d21d7closesodoo/odoo#75596
X-original-commit: efdfe261afd933972869305fd3358c764f7c18c3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Regarding previous commit, the option parameter can be removed
from _get_asset_content api, followed by a nice snowball effect.
Part-of: odoo/odoo#75248
Before this commit clicking between the buttons of the link popover
widget did deselect the link. When this happened, if edit was clicked
and the edited link was one within the popover widget instead of the one
on the page.
After this commit clicking on the popover between the buttons has no
effect anymore.
task-2630257
closesodoo/odoo#75544
X-original-commit: 536f72333297ea70cd06c83d92ab0d8f25c0142e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso-odoo@users.noreply.github.com>
Somehow, trying to forward-port the work done at [1] makes it impossible
for the link popover tour test to pass (although that test already
existed in the version where that original work was merged). It's
unclear why the test did not fail before but hopefully it did here: this
reveals a race condition in the editor code where the link popover is
fully shown to the user while clicking on some of its button would have
no effect... because those rely on clicking in the editor panel which is
potentially not up-to-date yet.
This commit fixes the problem in a hacky way, waiting for the editor
panel to be updated before showing the popover but it should not be
necessary in a better refactored codebase.
[1]: https://github.com/odoo/odoo/pull/74861
Part of https://github.com/odoo/odoo/pull/74959
Add an option in the masonry snippet's allowing to choose among multiple
templates for the snippet layout. The usability of the snippet also has
been reviewed (restrict the ability to control background on deeper
boxes). Also reviewed the bg-200 use on boxes and replaced them with
a preset as otherwise it seems buggy to not be able to remove the
bg-200 by selecting a preset (other than hitting the trash icon in the
colorpicker).
Part of https://github.com/odoo/odoo/pull/67361
task-2463033
closesodoo/odoo#67361
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: smottet <oms@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit improves action helper message for visitors menus of
website and removes old action helper message from visitor menu
of livechat for better onboarding.
Menus
1) Visitors(action -> website_visitors_action)
Task-2584073
PR odoo/odoo#74082
Related: odoo/enterprise#20125
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As nicely pointed by @kig-odoo at [1], the new feature of snippet
visibility conditions introduced in [2] has some issues. This fixes
the fact that condition identifiers were built by combining IDs without
a separator. A condition targeting a lang with ID:4 and another one with
ID:5 could thus produce the same condition identifier as another
condition targeting a lang with ID:45 (as 4 and 5 side-by-side makes
45...). Now, all parts of the identifiers are separated with '_'.
[1]: https://github.com/odoo/odoo/pull/67140#issuecomment-902531321
[2]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05dfclosesodoo/odoo#75386
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the newsletter popup was using its own mechanism instead of
the popup snippet, making a lot of extra code.
Now, the newsletter popup snippet just use the behavior of both the popup
snippet and the newsletter snippet.
Community: https://github.com/odoo/odoo/pull/74667
Upgrade: https://github.com/odoo/upgrade/pull/2742
task-2246975
The algorithm extracting primary and secondary colors from
an image automatically mitigates too bright colors. A color
component is considered as too bright if its value is above
an arbitrary value. We re-use this algorithm in the website
configurator to extract colors from logo and to generate a
palette. In this particular case we don't want the mitigation
to be applied. We therefore added the mitigation threshold as
a parameter of 'extract_image_primary_secondary_colors' and
avoided any mitigation by setting it to 255 in our case.
task-2602521
closesodoo/odoo#75255
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web
After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.
The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.
Part of https://github.com/odoo/odoo/pull/73611
task-2599770
closesodoo/odoo#73611
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
Previous implementation always updated *current website*, which is not
always the same as the value from `res.config.settings`.
---
opw-2623007
X-original-commit: d66d44db031be76403ce7c01616e334ef196fd03
When a color combination was used as "color" (base case) for the menu,
the menu background in the boxed template, the footer or the copyright
section, it was not properly marked as selected in the color palette
widget of the editor panel.
Related to task-2599770
closesodoo/odoo#75157
X-original-commit: 04c476a11a084c825725cae89e104e9f205c685b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Remove read access on `ir.model`, `ir.model.fields`, `ir.model.fields.selection` and `ir.model.data` for employees.
To access such records, the code must use the helpers (`_get`, `ref`,...) instead of CRUD operations directly.
Simplify the helpers to ir.model.data that were public and redundant.
self.env.ref is encouraged instead but with the slight drawback that `ref` makes a call to `exists()` (`_xmlid_lookup` can be used if this wants to be avoided).
Part of task-id 8203
closesodoo/odoo#69120
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The attribute lang was set in the template website.website_configurator.
This is not needed. This commit therefore remove this code.
task-2602521
closesodoo/odoo#74931
X-original-commit: d65efdb9896664cba132a08fe85dad6baa348f3b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Coupons and promotion programs can now be shared by creating a link that can
directly be used by the customer.
Using the link, the system will try to apply the coupon/promotion to the
customer's order.
If this can't be done, the error will be shown to the user, for instance
"A minimum amount of 1000$ is required to get the free ipad".
That coupon/promotion will then be stored in session and the system will try
automatically reapply it when something is added to the cart.
task-2489749
closesodoo/odoo#69053
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
*: tools
The app received many fixes and its code was improved and cleaned. It
was about time to include it directly into the website features.
task-2215118
closesodoo/odoo#74697
Related: odoo/design-themes#478
Related: odoo/upgrade#2709
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
It creates race condition, as it contact external ressource, in this case
facebook.com.
Tests should never call external services anyway, it always lead to race
condition.
closesodoo/odoo#74704
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
In order to limit encoding decoding, the _render method returns a
unicode string in the markup safe object instead of a MarkupSafeBytes
closesodoo/odoo#68299
Related: odoo/upgrade#2454
Related: odoo/enterprise#17270
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
* Remove AST in favor of pure Pyhon. This should make it easier for
developers to understand and create new directives because they do not
need to know AST.
* Remove `t-call-options` as it has been merged into `t-options` for more
consistency. Support for t-call-options is retained.
* Use generators for lists. This increases performances as the rendering
can be sent directly without having to wait for the creation of the
entire list.
* Optimize expressions runtime computation by pre-computing the static
parts.
Example:
'<' + 'div' + '>' + '<' + dynamic_value + '>'
Now compiles as:
'<div><' + dynamic_value + '>'
Previously, the debug manager was rewritten with the new webclient
architecture, however, because the frontend did not have access to the
new infrastructure (env and services), the old debug manager was kept
and used only in the frontend.
Since odoo/odoo#72675 the new env and services are now available, this
commit simply uses the new debug manager in the frontend and removes the
legacy code.
closesodoo/odoo#74609
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Edit a website menu label with:
& < > " ` '
This is what is shown after saving:
& < > " ` '
This is happening since ea4dbcd240: characters &, <, >, ", `, and ' are
now always escaped. Before that commit, only < and > where escaped and
only when an image was inside the label.
With this change, we unescape the label when we are editing a menu.
opw-2609413
closesodoo/odoo#74558
X-original-commit: ab77054987287444c5f6141b047a63bab4b67baa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
*: web, website_livechat, website_sale_comparison
Before this commit, bottom fixed elements (e.g. the livechat button)
hid the buttons to go to the next step in website sale when these
buttons are located at the bottom of the page, on some screen sizes.
After this commit,
- A bottom fixed element is hidden if this element hides a button at
the bottom of the page.
- Bottom fixed elements are hidden if a modal is open
to prevent it to hide buttons or any important part of the modal.
task-2501400
closesodoo/odoo#74515
X-original-commit: a851db9495fe9d8c1951f218a71e4d4a427cf96d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The configurator takes care of the organization of the links to the different
pages. Some links are put in the menu and some are put in the footer. The order
is predefined. If too many links are present in the menu then a sub-menu 'Company'
is created and some links are put in it. For the 'News' and 'Succes Stories' features
a website specific blog is created.
Links have the following order in the menu and are present only if their corresponding
website.configurator.feature has been selected in the configurator excepted for the 'Home'
and 'Contact us' links which are default links:
- 'Home'
- 'Shop'
- 'Event'
- 'Courses'
- 'Services'
- 'Pricing'
- 'Company': if more than 8 links in menu and more than 1 item in this submenu
otherwise the three following links are in the top menu.
- 'News'
- 'Success Stories'
- 'About us'
- 'Appointment'
- 'Contact us'
Links in footer:
- 'Privacy Policy'
- 'Help': if website_helpdesk installed. This is not a website.configurator.feature.
- 'Forum'
Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930
task-2518565
Co-authored-by: Sébastien Mottet (oms) <oms@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Before this commit, if the configurator was applied without a module to install
it would still go through `_button_immediate_function()` which does
```
self._cr.commit()
api.Environment.reset()
modules.registry.Registry.new(self._cr.dbname, update_module=True)
```
for no reason, even if `self` is an empty module recordset.
This code is taking ~5 seconds.
This flow will occur when you either:
- Create a new website when selecting only page feature
- Create a new website when some modules feature are already installed
Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930
task-2518565
Image gallery snippet when dropped is throwing a traceback.
This lead to the editor not usable anymore, as any JS error will prevent any
further action (no JS will work anymore).
This introduce a test that will drag and drop every snippet in a page and click
on it to load its settings in the right panel.
Note that it will remove the snippet before drag & dropping the next one, as
having too many snippet will impact the perf, even killing the browser entirely
if there is a lot.
task-2604383
closesodoo/odoo#74135
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.
Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.
The geoip country had to be added to the session for the feature to work
with countries.
Part of https://github.com/odoo/odoo/pull/67140
task-2381049
closesodoo/odoo#67140
Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Issue: traceback when website editor is entered and theme options are
clicked on themes using an unknown-to-the-editor font family (see for
the theme repo fix for such an example).
opw-2559735
closesodoo/odoo#74423
X-original-commit: c664cf1a1fb4b6781fe2802e66c993cfa1a4a028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
On the 'Contact us' form of the 'website' module, the client can
auto-fill the fields with the 'false' text string when the logged
partner has some missing values. This happens because the server
set the missing values to 'false' and the client directly uses those
values to update the form fields.
To solve the issue, the client will replace the falsy values set by
the server with an empty string before updating the form fields. That
way, the form fields will no longer be filled with the 'false' text
string.
task-2610948
Fixes 116d55d62fd411d3be5d9f0885dadac530839b99
closesodoo/odoo#74256
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit,
User was allowed to create new records from form view through
Graph view' action. Since we do not have a way to prevent opening
form view from Graph and also we should not Introduce new form view
on stable version.
With this commit,
we are disabling create/edit/copy from action.
closesodoo/odoo#74288
X-original-commit: e8c5302e5cb11f185d1d5b1ef43ab641b2be6f76
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Before this commit, anchor select on link dialig was never shown
-> xpath done on attribute class but t-attf-class is used
Now we show the anchor input.
This commit also avoid useless anchor detection for empty url and external url.
Or in case of the selected url is the same than the last one loaded.
E.g. type /contactus -> load anchor -> choose one identicalfrom list
before -> reload anchor
now -> we don't refresh anchor screen
X-original-commit: 8e11a0b
closes odoo#74164
closesodoo/odoo#74272
X-original-commit: 6c930e72b7d00f7beb4c43024c52a3e6c44a35f4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>