[FIX] website: fix the /website/info page
- Show the Odoo version only in debug mode to logged in user, as we do for the technical module name. The purpose of this page is to generate some backlinks and improve (does it really?) the SEO of Odoo.com. The Odoo version doesn't bring any value and is another way to easily retrieve DBs based on their version with a simple Google search. While there is many other ways to do so, let's avoid this one. - Prior to the introduction of `website.page` and the new page serve mechanism, there could be template collision when an user would create a page with the same key/name than the template of this controller. This is not the case anymore. We can remove the refresh meta tag. See [1] and [2]. - The check to see if the template exists is useless, we don't do that kind of check when rendering a controller, we just assume the view was not manually deleted by the user. I guess it was historically useful when people would not want that /website/info page to be show. But now, there is a clean way to "hide" this page by simply disabling it in the "Customize" option of the website in the navbar. [1]: https://github.com/odoo/odoo/commit/4cfd86edaa27d09f1066dd017bf466b8b30611e5 [2]: https://github.com/odoo/odoo/commit/7f6c669530ed7f9935de6516fadb7283ac00a9e4 closes odoo/odoo#91131 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
@@ -236,10 +236,6 @@ class Website(Home):
|
||||
|
||||
@http.route('/website/info', type='http', auth="public", website=True, sitemap=True)
|
||||
def website_info(self, **kwargs):
|
||||
try:
|
||||
request.website.get_template('website.website_info').name
|
||||
except Exception as e:
|
||||
return request.env['ir.http']._handle_exception(e)
|
||||
Module = request.env['ir.module.module'].sudo()
|
||||
apps = Module.search([('state', '=', 'installed'), ('application', '=', True)])
|
||||
l10n = Module.search([('state', '=', 'installed'), ('name', '=like', 'l10n_%')])
|
||||
|
||||
@@ -2066,12 +2066,8 @@
|
||||
<xpath expr="//div[@id='wrap']" position="inside">
|
||||
<div class="oe_structure">
|
||||
<section class="container">
|
||||
<t t-if="not version">
|
||||
<meta http-equiv="refresh" content="0;URL='/website/info'" />
|
||||
</t>
|
||||
<t t-if="version">
|
||||
<h1><t t-esc="res_company.name"/>
|
||||
<small>Odoo Version <t t-out="version.get('server_version')"/></small>
|
||||
<small groups='base.group_no_one'>Odoo Version <t t-out="version.get('server_version')"/></small>
|
||||
</h1>
|
||||
<p>
|
||||
Information about the <t t-esc="res_company.name"/> instance of Odoo, the <a target="_blank" href="https://www.odoo.com">Open Source ERP</a>.
|
||||
@@ -2113,7 +2109,6 @@
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</t>
|
||||
</section>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user