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

Module: Products - Drained Weight

Entity: product.template

Compute Method: _compute_drained_weight

View 19.0
Inputs Method Outputs
  • product_variant_ids
  • product_variant_ids.drained_weight
+ unique_variants = self.filtered(lambda tmpl: tmpl.product_variant_count == 1)
+ for template in unique_variants:
+             template.drained_weight = template.product_variant_ids.drained_weight
+ for template in self - unique_variants:
+             template.drained_weight = 0.0
  • drained_weight

Back to entity