[IMP] website: avoid query on website table when serving empty page
Getting the `res.company` record by browsing the `company_id` cached value from `website` instead of reading it directly on the website record will avoid a read on the website table. While this might seems unusual and not elegant, since this is a very low level method used to render every view, it seems fine. task-2774979 X-original-commit: bc643a573a7339c82661cbcff2cc59bdd0eec3e3 Part-of: odoo/odoo#85456
This commit is contained in:
@@ -116,7 +116,7 @@ class TestWebsitePerformance(UtilPerf):
|
||||
# website.page with no call to layout templates
|
||||
self.page.arch = '<div>I am a blank page</div>'
|
||||
self.assertEqual(self._get_url_hot_query(self.page.url), 5)
|
||||
self.assertEqual(self._get_url_hot_query(self.page.url, cache=False), 6)
|
||||
self.assertEqual(self._get_url_hot_query(self.page.url, cache=False), 5)
|
||||
|
||||
def test_40_perf_sql_queries_page_multi_level_menu(self):
|
||||
# menu structure should not impact SQL requests
|
||||
|
||||
Reference in New Issue
Block a user