From 16d84389553a0057c3c8277df24cd8f7636beeed Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 21 Mar 2024 10:42:11 +0100 Subject: [PATCH] [FIX] website_blog: prevent helpdesk module to mess with blog perf tour Commit [1] was introduced to fix an issue where the website menu cache is incompatible with having a slug url in one of its menu. But in the enterprise build, since the website_helpdesk module is adding one menu containing a slug url, it would disable the menu cache. Unfortunately, the website_blog perf tests (at_install) are executed after website_helpdesk is installed, meaning that in enterprise, the perf test of website_blog would fail since it would require some more SQL Queries (1 or 2 depending of the test) to render a blog post as it would have to query the website.menu table. It's still unclear how commit [1] was merged in the codebase since the enterprise staging should have failed. runbot-60466 runbot-60467 [1]: https://github.com/odoo/odoo/commit/948235079f002794f9837d3cf91e2d20e3254e20 closes odoo/odoo#158666 X-original-commit: 11acdfc7d8dd0dfe146b6f7547123af94e2a0baf Signed-off-by: Guillaume Dieleman (gdi) Signed-off-by: Romain Derie (rde) --- addons/website_blog/tests/test_performance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/website_blog/tests/test_performance.py b/addons/website_blog/tests/test_performance.py index cbb6e7ed1fd..37b56b75de1 100644 --- a/addons/website_blog/tests/test_performance.py +++ b/addons/website_blog/tests/test_performance.py @@ -12,6 +12,12 @@ class TestBlogPerformance(UtilPerf): if 'channel_id' in self.env['website']: self.env['website'].search([]).channel_id = False + # remove menu containing a slug url (only website_helpdesk normally), to + # avoid the menu cache being disabled, which would increase sql queries + self.env['website.menu'].search([ + ('url', '=like', '/%/%-%'), + ]).unlink() + self.env['blog.blog'].search([]).active = False blogs = self.env['blog.blog'].create([{ "name": 'aaa Blog Test',