We'll have to adapt the existing template and override the existing handler. We can do this as follows:
- Override the qweb template in a file called views/templates.xml, as follows:
<?xml version="1.0" encoding="UTF-8"?> <odoo> <template id="show_website_info"
inherit_id="website.show_website_info">
<xpath expr="//dl[@t-foreach='apps']" position="replace"> <table class="table"> <tr t-foreach="apps" t-as="app"> <th> <a t-att-href="app.website"> <t t-esc="app.name" /></a> </th> <td><t t-esc="app.summary" /></td> </tr> </table> </xpath> </template> </odoo>
- Override the handler in a file called controllers/main.py, as shown in the following example:
from odoo import http from odoo.addons.website.controllers.main import Website class WebsiteInfo(Website):
@http.route()
def website_info(self):
result = super(WebsiteInfo, self).website_info()
result.qcontext['apps'] = result.qcontext['apps'].filtered(
lambda x: x.name != 'website'
)
return result
Now, when visiting the info page, we'll only see a filtered list of installed applications in a table, as opposed to the original definition list.