Odoo 12 Development Cookbook - Third Edition
by Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
How it works...
Our first step was to create a Python file where our new module was created.
The Odoo framework has its own ORM framework. This ORM framework provides abstraction over the PostgreSQL database. By inheriting the Odoo Python class Model, we can create our own model (table). When a new model is defined, it is also added to a central model registry. This makes it easier for other modules to make modifications to it later.
Models have a few generic attributes prefixed with an underscore. The most important one is _name, which provides a unique internal identifier that will be used throughout the Odoo instance. The ORM framework will generate the database table based on this attribute. In our recipe, we used _name = 'library.book' ...
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