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: purchase.order.line

Compute Method: _compute_qty_invoiced

Inputs Method Outputs
invoiced_quantities = self._prepare_qty_invoiced()
for line in self:
            line.qty_invoiced = invoiced_quantities[line]

            # compute qty_to_invoice
            if line.order_id.state == 'purchase':
                if line.product_id.purchase_method == 'purchase':
                    line.qty_to_invoice = line.product_qty - line.qty_invoiced
                else:
                    line.qty_to_invoice = line.qty_received - line.qty_invoiced
            else:
                line.qty_to_invoice = 0

Back to entity