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

Module: Supplier invoices on HR expenses

Entity: hr.expense.sheet

Compute Method: _compute_invoice_count

Inputs Method Outputs
  • expense_line_ids
Invoice = self.env["account.move"]
can_read = Invoice.check_access_rights("read", raise_exception=False)
for sheet in self:
            sheet.invoice_count = (
                can_read and len(sheet.expense_line_ids.mapped("invoice_id")) or 0
            )

Back to entity