Thomas Lefebvre (thle) 949b4f3c73 [FIX] website_sale: correct tag search domain
Steps to reproduce:
-------------------
- create a product tag (eCommerce / Product Tags);
- go to a product page and open editor;
- edit the page adding a "Products" block;
- add the created product tag;
- remove it and save;

Issue:
------
No products are displayed, whereas without tags,
a default product set should be displayed.

Cause:
------
At first, when we don't have a tag, the domain determined
for the search is `[]`, which returns a list of products.

When we add the tag, a domain will be built with the products
linked to this tag: `['all_product_tag_ids, 'in', []]`
(in the case of the use case above, there will be none).
The attribute `data-product-tag-ids="[]"` is added to
the dynamic snippet section.

Then, when we remove it, we will get the same domain:
because the string `"[]"` is valid for the condition
that checks whether `productTagIds` exists.

As a result, it will no longer be possible to obtain
the default set for this block.

Solution:
---------
Try to reduce the domain to a list in all cases and compare its length.
If it is empty, the domain must be an empty domain.

opw-3859482

closes odoo/odoo#163324

X-original-commit: c18ab6acf63885401a3e702f912622369197bdf7
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2024-04-26 05:21:50 +00:00
2024-04-15 09:10:09 +00:00
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%