Manual forward port, commit was lost from 15.2 to master. Either it seemed not needed after the httpocalypse refactoring, or was simply lost during the rebase. ----- We can remove an useless SQL Query for public user on every single page serve, if we directly set the website's company_id in the available company_ids of the public user. Indeed, the public user from a website always have the same company_id as the website. We can then do that directly and bypass the next line which will always be true in the case of the public user, making a read for nothing. task-2774979 closes #85419 X-original-commit: c95ab6f [1]: https://github.com/odoo/odoo/commit/728ade674cb12c64718efda56b0d5d542e319cba closes odoo/odoo#87856 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
12 lines
429 B
Python
12 lines
429 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.website.tests.test_performance import UtilPerf
|
|
|
|
|
|
class TestPerformance(UtilPerf):
|
|
def test_10_perf_sql_website_controller_minimalist(self):
|
|
url = '/empty_controller_test'
|
|
self.assertEqual(self._get_url_hot_query(url), 1)
|
|
self.assertEqual(self._get_url_hot_query(url, cache=False), 1)
|