Files
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
..