Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Website

Entity: website.page.properties.base

Compute Method: _compute_is_homepage

Inputs Method Outputs
for record in self:
            url = record.url
            current_homepage_url = record.website_id.homepage_url or '/'
            # If the url field matches the website's homepage_url, we know this
            # is the homepage.
            # However, the url field contains the url of the accessed route.
            # Therefore, being on '/' means we went through the homepage
            # controller and the request was rerouted.
            record.is_homepage = url == current_homepage_url or url == '/'

Back to entity