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_product_document_count

Inputs Method Outputs
for template in self:
            template.product_document_count = template.env['product.document'].search_count([
                '|',
                    '&', ('res_model', '=', 'product.template'), ('res_id', '=', template.id),
                    '&',
                        ('res_model', '=', 'product.product'),
                        ('res_id', 'in', template.product_variant_ids.ids),
            ])

Back to entity