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

Module: Forum

Entity: forum.forum

Compute Method: _compute_has_pending_post

Inputs Method Outputs
domain = [
            ('create_uid', '=', self.env.user.id),
            ('state', '=', 'pending'),
            ('parent_id', '=', False),
        ]
pending_forums = self.env['forum.forum'].search([
            ('id', 'in', self.ids),
            ('post_ids', 'any', domain),
        ])
pending_forums.has_pending_post = True
(self - pending_forums).has_pending_post = False

Back to entity