The convention for class identifiers is to use CamelCase.This follows the Python standard defined by the PEP8 coding conventions.
Since there is no risk of collision with classes in other modules, there is no need for class identifiers to be prefixed by the main application they relate to.
Python classes, on the other hand, are local to the Python file where they are declared.The identifier used for them is only significant for the code in that file, and is rarely relevant.
Model names must be globally unique.Because of this, the first word should correspond to the main application the module relates to.For our Library app features, we will prefix all models with library.Other examples from the core modules are project, crm, and sale.
For historical reasons, it is possible to find some core models that don't follow this, such as res.users, but this is not the rule.
We should use the singular form for model names: library.book rather than library.books.
You can see that model names are important since they are the keys used to access the registry.The convention for model names is to use a list of lowercase words joined with dots, such as library.book or library.book.category.Other examples from the core modules are project.project, project.task, and project.task.type.
Specifically, the code in a model method can use self.env['library.book'] to retrieve the model class representing the library.book model.
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.
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.