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

Module: eCommerce

Entity: product.template

Compute Method: _compute_base_unit_id

Inputs Method Outputs
  • product_variant_ids
  • product_variant_ids.base_unit_id
self.base_unit_id = self.env['website.base.unit']
for template in self.filtered(lambda template: len(template.product_variant_ids) == 1):
            template.base_unit_id = template.product_variant_ids.base_unit_id

Back to entity