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 this when installing or upgrading the module. The mechanism responsible for this is theĀ Object Relational Model (ORM).
Our module will be a very simple application to keep to-do tasks. These tasks will have a single text field for the description and a checkbox to mark them as complete. We should later add a button to clean the to-do list of the old, completed tasks.
Creating the data model
The Odoo development guidelines state that the Python files for models should be placed inside a models
subdirectory. For simplicity, we won&apos...