[FIX] web, *: debug icon consistency according to the mode and the url

*: website

X-original-commit: 0cd55d90121cd5bcebdf4c7b0212910ef44a9d85
Part-of: odoo/odoo#95222
This commit is contained in:
Gorash
2022-07-06 17:10:17 +02:00
committed by qsm-odoo
parent 5a2c267c20
commit ae3354b306
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -322,7 +322,7 @@
</template>
<template id="debug_icon" name="Debug Icon">
<t t-if="debug">
<t t-if="debug" t-nocache="The query strings and debug mode can change for the same page and the same rendering.">
<t t-set="debug_mode_help" t-value="' (%s)' % debug if debug != '1' else ''"/>
<a t-attf-href="?#{keep_query('*', debug='')}" t-attf-title="Debug mode is activated#{debug_mode_help}. Click here to exit debug mode."
class="o_debug_mode"><span class="fa fa-bug"/></a>
+9
View File
@@ -303,3 +303,12 @@ class WithContext(HttpCase):
root_html = html.fromstring(r.content)
canonical_url = root_html.xpath('//link[@rel="canonical"]')[0].attrib['href']
self.assertEqual(canonical_url, website.domain + "/")
def test_t_cache_footer_debug_link(self):
# Debug link (flag) should be use the current url.
self.url_open('/')
self.url_open('/contactus')
r = self.url_open('/?debug=1')
self.assertIn('<a class="o_debug_mode" href="?debug="', r.text)
r = self.url_open('/contactus?debug=1')
self.assertIn('<a class="o_debug_mode" href="?debug="', r.text)