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

Module: Stock Request kanban

Entity: product.template

Compute Method: _compute_kanban_card_count

Inputs Method Outputs
  • id
for product in self:
            count = 0
            for variant in product.product_variant_ids:
                count += self.env["stock.request.kanban"].search_count(
                    [("product_id", "=", variant.id)]
                )
            product.kanban_card_count = count

Back to entity