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

Module: Purchase Blanket Orders

Entity: purchase.blanket.order.line

Compute Method: _compute_quantities

Inputs Method Outputs
for line in self:
            purchase_lines = line.purchase_lines
            line.ordered_uom_qty = sum(
                pol.product_uom._compute_quantity(pol.product_qty, line.product_uom)
                for pol in purchase_lines
                if pol.order_id.state != "cancel" and pol.product_id == line.product_id
            )
            line.invoiced_uom_qty = sum(
                pol.product_uom._compute_quantity(pol.qty_invoiced, line.product_uom)
                for pol in purchase_lines
                if pol.order_id.state != "cancel" and pol.product_id == line.product_id
            )
            line.received_uom_qty = sum(
                pol.product_uom._compute_quantity(pol.qty_received, line.product_uom)
                for pol in purchase_lines
                if pol.order_id.state != "cancel" and pol.product_id == line.product_id
            )
            line.remaining_uom_qty = line.original_uom_qty - line.ordered_uom_qty
            line.remaining_qty = line.product_uom._compute_quantity(
                line.remaining_uom_qty, line.product_id.uom_id
            )

Back to entity