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
  • product_variant_ids
  • uom_id
  • uom_id.rounding
for template in self.with_context(active_test=False):
            template.purchased_product_qty = float_round(sum(p.purchased_product_qty for
                p in template.product_variant_ids), precision_rounding=template.uom_id.rounding
            )

Back to entity