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_item_count

View 17.0 View 18.0
Inputs Method Outputs
  • id
  • product_variant_ids
  • product_variant_ids.ids
for template in self:
            # Pricelist item count counts the rules applicable on current template or on its variants.
            template.pricelist_item_count = template.env['product.pricelist.item'].search_count([
                '&',
                '|', ('product_tmpl_id', '=', template.id), ('product_id', 'in', template.product_variant_ids.ids),
                ('pricelist_id.active', '=', True),
+                 ('compute_price', '=', 'fixed'),
            ])
  • pricelist_item_count

Back to entity