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

Module: Project Purchase Link

Entity: project.project

Compute Method: _compute_purchase_info

Inputs Method Outputs
for project in self:
            groups = self.env["purchase.order.line"].read_group(
                project._domain_purchase_order_line(),
                ["price_subtotal"],
                ["order_id"],
            )
            purchase_line_total = 0
            for group in groups:
                purchase_line_total += group["price_subtotal"]
            project.purchase_count = len(groups)
            project.purchase_line_total = purchase_line_total

Back to entity