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: _inherited_models

View 18.0 View 20.0
Inputs Method Outputs
  • model
self.inherited_model_ids = False
for model in self:
-             parent_names = list(self.env[model.model]._inherits)
-             if parent_names:
-                 model.inherited_model_ids = self.search([('model', 'in', parent_names)])
-             else:
-                 model.inherited_model_ids = False
+             records = self.env.get(model.model)
+             if records is not None:
+                 model.inherited_model_ids = self.search([('model', 'in', list(records._inherits))])
  • inherited_model_ids

Back to entity