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.attribute

Compute Method: _compute_products

Inputs Method Outputs
  • id
templates_by_attribute = {
            attribute.id: templates
            for attribute, templates in self.env['product.template.attribute.line']._read_group(
                domain=[('attribute_id', 'in', self.ids)],
                groupby=['attribute_id'],
                aggregates=['product_tmpl_id:recordset']
            )
        }
for pa in self:
            pa.with_context(active_test=False).product_tmpl_ids = templates_by_attribute.get(pa.id, False)

Back to entity