Files
odoo_source/addons/website_slides/controllers
Thibault Delavallée c19eba99d7 [FIX] website(_slides): correctly check can_publish status at create
Currently creating a record with 'is_published' being False (aka not published)
crashes when people can't publish. However 'is_published' being False is the
default value, and create should work in both cases.

It now correctly checks that published records could effectively be published.
This allows to remove a small workaround done in eLearning.

See odoo/odoo@4086f344d8 for ref.

Only failing use case would be having

    def _default_is_published(self):
        return True

    def _compute_can_publish(self):
        for record in self:
            record.can_publish = self.env.user.has_group('something')

But this would not be a really valid use case: not being able to publish
but having default publish to True makes no sense: what matters is publishing
records as it gives more visibility to records, not the flag change itself.

Followup of odoo/odoo#70291

Task-3299702

closes odoo/odoo#137900

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-27 11:34:55 +00:00
..
…