The model layer

Now that Odoo knows about our new module, let's start by adding 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.

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 component responsible for this is the Object Relational Mapping (ORM).

Our module will be a very simple application to maintain To-Do tasks. These tasks will have a single text field for the description and a checkbox to mark them as complete. ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.