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

Module: Products & Pricelists

Entity: product.template

Compute Method: _compute_has_configurable_attributes

View 17.0 View 18.0
Inputs Method Outputs
  • attribute_line_ids
"""A product is considered configurable if:
        - It has dynamic attributes
        - It has any attribute line with at least 2 attribute values configured
        - It has multi-checkbox display type
        - It has at least one custom attribute value
        """
for product in self:
            product.has_configurable_attributes = (
                product.has_dynamic_attributes() or any(
-                     ptal.attribute_id.display_type == 'multi'
-                     or len(ptal.value_ids) >= 2
-                     or ptal.value_ids.is_custom
+                     ptal._is_configurable()
                    for ptal in product.attribute_line_ids
                )
            )
  • has_configurable_attributes

Back to entity