[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) <gdi@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Romain Derie
2024-03-22 20:01:26 +00:00
parent 5fc2e57d26
commit 16d8438955
@@ -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',