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

Module: Manufacturing

Entity: product.product

Compute Method: _compute_used_in_bom_count

View 17.0 View 19.0
Inputs Method Outputs
  • id
for product in self:
-             product.used_in_bom_count = self.env['mrp.bom'].search_count([('bom_line_ids.product_id', '=', product.id)])
+             product.used_in_bom_count = self.env['mrp.bom'].search_count(
+                 [('bom_line_ids.product_id', 'in', product.ids)])
  • used_in_bom_count

Back to entity