From 73b1f73a6990157eedf7879ba76e45afa6580057 Mon Sep 17 00:00:00 2001 From: Florian Damhaut Date: Thu, 17 Mar 2022 12:10:32 +0000 Subject: [PATCH] [FIX] website_sale: strip category description from html tags Step to reproduce: - In e-commerce go to a category - Edit the page to add a text block at the beginning - Save - Go back to main page - Search the category Current behaviour: - The search bar show the text block as the category description But the description also contains the html linked to the bloc which lead to ugly unhelpful description Behaviour after PR: - html tags are stripped from the description returned to the search bar opw-2781450 closes odoo/odoo#87454 X-original-commit: 25952894b0d07e60c79a212cbc05b4346bb36b1a Signed-off-by: Romain Derie (rde) Signed-off-by: Damhaut Florian (flda) --- addons/website_sale/models/product_public_category.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/product_public_category.py b/addons/website_sale/models/product_public_category.py index b22c141c6e6..2dac4a3e867 100644 --- a/addons/website_sale/models/product_public_category.py +++ b/addons/website_sale/models/product_public_category.py @@ -62,7 +62,7 @@ class ProductPublicCategory(models.Model): if with_description: search_fields.append('website_description') fetch_fields.append('website_description') - mapping['description'] = {'name': 'website_description', 'type': 'text', 'match': True} + mapping['description'] = {'name': 'website_description', 'type': 'text', 'match': True, 'html': True} return { 'model': 'product.public.category', 'base_domain': [], # categories are not website-specific