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.published.mixin

Compute Method: _compute_can_publish

Inputs Method Outputs
""" This method can be overridden if you need more complex rights
        management than just write access to the model.
        The publish widget will be hidden and the user won't be able to change
        the 'website_published' value if this method sets can_publish False """
for record in self:
            try:
                self.env.website._check_user_can_modify(record)
                record.can_publish = True
            except AccessError:
                record.can_publish = False

Back to entity