From ddd976f551d1305a5bf83d95aa808fb4260c875b Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 9 Mar 2023 11:11:35 +0000 Subject: [PATCH] [FIX] website: review `t-cache` of the `` in website.layout The `t-cache` used on the `` of website.layout was wrong: it depended on the use of debug=assets or not (added by [1]) while it should at least also depend on debug=tests. This commit chooses to fix the issue by not using the caching system in case any value of debug is used. This commit also comments this `t-cache` value. Steps to reproduce: - As a visitor, first visit the homepage without debug mode - Now reach the homepage with ?debug=tests => You still don't have the tests assets Worse (but unlikely in production of course): - Create a fresh DB and first reach the homepage with debug=tests => Now all your visitors are damned to load the tests tours for no reason (and you likely have lots of errors shown in your console). [1]: https://github.com/odoo/odoo/commit/3061a484168ff21e3ae7e40ce691d299b63484a4 opw-3203912 closes odoo/odoo#114875 X-original-commit: 5efb637d880f82ea81bb64a0d091ffa7bdf7635b Signed-off-by: Romain Derie (rde) Signed-off-by: Quentin Smetz (qsm) --- addons/website/views/website_templates.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index b795172b8de..a69c084cbbf 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -55,7 +55,20 @@ - ('assets' in request.session.debug, main_object) if main_object and main_object._name == 'website.page' and not (editable or translatable) else None + + main_object if main_object and main_object._name == 'website.page' and not request.session.debug and not editable and not translatable else None