The model layer
Now that Odoo knows about our new module, let's add a simple model to it.
Models describe business objects, such as an opportunity, sales order, or partner (customer, supplier, and so on). A model has a list of attributes and can also define its specific business logic.
Models are implemented using a Python class derived from an Odoo template class. They translate directly to database objects, and Odoo automatically takes care of that when installing or upgrading the module. The framework component responsible for this is Object Relational Mapping (ORM).
Our module will be an application to manage a library, and the first feature we need is to manage the book catalogue, so at this point, this will be the only model we need ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access