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

Entity: document.page.history

Compute Method: _compute_diff

Inputs Method Outputs
"""Shows a diff between this version and the previous version"""
history = self.env["document.page.history"]
for rec in self:
            prev = history.search(
                [
                    ("page_id", "=", rec.page_id.id),
                    ("create_date", "<", rec.create_date),
                ],
                limit=1,
                order="create_date DESC",
            )
            rec.diff = self._get_diff(prev.id, rec.id)

Back to entity