[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) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
This commit is contained in:
Guillaume-gdi
2024-04-22 10:12:54 +00:00
parent daaa255f04
commit 9d37080b6a
+3
View File
@@ -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)