O'Reilly logo

Odoo Development Essentials by Daniel Reis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an application model

Now that Odoo knows about our new module, let's start by adding to it a simple model.

Models describe business objects, such as an opportunity, a sales order, or a 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.

Some consider it good practice to keep the Python files for models inside a models subdirectory. For simplicity we won't be following that here, so let's create a todo_model.py file in the todo_app module main directory.

Add the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required