From 9d37080b6a78997dbdf70bdbd92ac9ae5877943d Mon Sep 17 00:00:00 2001 From: Guillaume-gdi Date: Fri, 19 Apr 2024 08:33:22 +0200 Subject: [PATCH] [FIX] website: fix blog top banner latest post option Before this commit an error appeared if a block had been set at the top of the /blog page and the user wished to re-enable the 'Top banner - Name / Latest Post' option. This commit resolves the issue by giving higher priority to the activated view. Steps to reproduce the fixed bug: - Go on /blog page - Disable the customize option "Top banner - Name / Latest Post" - Enter in edit mode - Add a snippet to the top (in the oe_structure) - Save the page - Enable the customize option "Top banner - Name / Latest Post" => An error happens. task-2774944 closes odoo/odoo#162620 X-original-commit: 5880aac0c79330e5ef62c475102d53765895cec4 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Guillaume Dieleman (gdi) --- addons/website/controllers/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 862d9e27610..ecfe723ba08 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -819,6 +819,9 @@ class Website(Home): if enable: records = self._get_customize_data(enable, is_view_data) + if 'website_blog.opt_blog_cover_post' in enable: + # TODO: In master, set the priority in XML directly. + records.filtered_domain([('key', '=', 'website_blog.opt_blog_cover_post')]).priority = 17 records.filtered(lambda x: not x.active).write({'active': True}) @http.route(['/website/theme_customize_bundle_reload'], type='json', auth='user', website=True)