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

Module: eLearning

Entity: slide.slide

Compute Method: _compute_mark_complete_actions

Inputs Method Outputs
"""Determine if the slide can be marked as (un)completed.

        We can't mark a slide with questions as completed manually because we need to
        complete the quiz first. But we can mark as uncompleted a slide with questions,
        and the answers will be reset, the karma removed, etc (see mark_uncompleted).
        """
for slide in self:
            slide.can_self_mark_uncompleted = slide.website_published and slide.channel_id.is_member
            slide.can_self_mark_completed = (
                slide.website_published
                and slide.channel_id.is_member
                and slide.slide_category != 'quiz'
                and not slide.question_ids
            )

Back to entity