Models and Python classes

Odoo models are represented by Python classes. In the preceding code, we have a Python class, Book, based on the models.Model class, which defines a new Odoo model called library.book.

Odoo models are kept in a central registry, available in the env environment object (referred to as a pool in the old API). It is a dictionary that keeps references to all the model classes available in the database, and its entries can be referenced by a model name. Specifically, the code in a model method can use self.env['library.book'] to retrieve the model class representing the library.book model.

You can see that model names are important since they are the keys used to access the registry. The convention for model names is ...