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

Module: Document Page Approval

Entity: document.page

Compute Method: _compute_user_has_drafts

Inputs Method Outputs
  • id
history = self.env["document.page.history"]
for rec in self:
            changes = history.search_count(
                [("page_id", "=", rec.id), ("state", "=", "draft")]
            )
            rec.user_has_drafts = changes > 0

Back to entity