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

Module: Base

Entity: ir.model

Compute Method: _compute_count

View 18.0 View 20.0
Inputs Method Outputs
  • model
self.count = 0
for model in self:
-             records = self.env[model.model]
-             if not records._abstract and records._auto:
+             records = self.env.get(model.model)
+             if records is not None and not records._abstract and records._auto:
                [[count]] = self.env.execute_query(SQL("SELECT COUNT(*) FROM %s", SQL.identifier(records._table)))
                model.count = count
  • count

Back to entity