How to do it...

We'll have to adapt the existing template and override the existing handler:

  1. Override the qweb template in a file called views/templates.xml:
<?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>
  1. Override the handler in a file called controllers/main.py:
from odoo import http 
from odoo.addons.website.controllers.main import Website 
 
class Website(Website): 
    @http.route() 
    def website_info(self): 
        result = super(Website, 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, and in a table as opposed to the original definition list.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.77.32