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

Module: Purchase

Entity: account.move

Compute Method: _compute_is_purchase_matched

Inputs Method Outputs
  • invoice_line_ids
for move in self:
            product_lines = move.invoice_line_ids.filtered(lambda l: l.display_type == 'product')
            total = len(product_lines)
            matched = len(product_lines.filtered('purchase_line_id'))
            move.purchase_matched_ratio = 100.0 * matched / total if total else 0.0
            move.is_purchase_matched = matched == total and total > 0

Back to entity