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_comments_count

Inputs Method Outputs
  • id
count_by_slide = dict(
            self.env["mail.message"]._read_group(
                PortalWebClientController._get_portal_message_fetch_domain(self),
                groupby=["res_id"],
                aggregates=["__count"],
            )
        )
for slide in self:
            slide.comments_count = count_by_slide.get(slide.id, 0)

Back to entity