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: product.template

Compute Method: _compute_purchased_product_qty

Inputs Method Outputs
  • uom_id
  • product_variant_ids
for template in self.with_context(active_test=False):
            template.purchased_product_qty = template.uom_id.round(sum(p.purchased_product_qty for p in template.product_variant_ids))

Back to entity