From 2a41bfcb4d1e9c8e6f80d600de78e5a4b9fa24b5 Mon Sep 17 00:00:00 2001 From: "Julien (jula)" Date: Fri, 6 Oct 2023 14:32:51 +0200 Subject: [PATCH] [FIX] website_sale: shows correct product attribute `display_type` __Current behavior before commit:__ When changing the `display_type` of an attribute in the website editor, the page is reloaded. However the template `website_sale.product` is contained in a `t-cache` on "pricelist,product". This means that the template will not be rendered again when the page is reloaded. Thus, the change will not appear for the user. __Description of the fix:__ Flush the cache from the `ir.qweb` model when the attribute display type is edited. This way the template `website_sale.product` will be refreshed. __Steps to reproduce the issue on runbot:__ - Go on the website product page of *Customizable Desk* - Open the website editor - Click on the Legs attribute values - Under the **Block** section, change the **Display Type** The page is reloaded but the display type stays the same ([Video][1]) opw-3495159 opw-3493820 [1]: https://drive.google.com/file/d/142VP4prnHskfa7uFoEkadsoQfQVO-uyW/view closes odoo/odoo#137498 X-original-commit: cc8664973efd7ea3433b5ec5b741f0882fb17dc0 Signed-off-by: Julien Launois (jula) --- addons/website_sale/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 3d0ea320c7d..eba3e7d7d51 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -1800,6 +1800,7 @@ class WebsiteSale(payment_portal.PaymentPortal): attribute = request.env['product.attribute'].browse(attribute_id) if 'display_type' in options: attribute.write({'display_type': options['display_type']}) + request.env.registry.clear_cache('templates') @http.route(['/shop/config/website'], type='json', auth='user') def _change_website_config(self, **options):