Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Product logistics UoM
Entity: product.template
Compute Method: _compute_product_weight
| Inputs | Method | Outputs |
|---|---|---|
|
- unique_variants = self.filtered( - lambda template: len(template.product_variant_ids) == 1 - ) - for template in unique_variants: - template.product_weight = template.product_variant_ids.product_weight - for template in self - unique_variants: - template.product_weight = 0.0 + for template in self: + template.product_weight = ( + template.product_variant_ids.product_weight + if template.product_variant_count == 1 + else 0.0 + ) |
|
