For the to-do tasks to have a kanban board, we need Stages. Stages are board columns, and each task will fit into one of these columns:

Here we created the two new models that will be referenced in the to-do tasks.

Focusing on the task stages, we have a Python class, Stage, based on the models.Model class, which defines a new Odoo model called todo.task.stage. We also have two fields: name and sequence. We can see some model attributes (prefixed with an underscore) that are new to us. Let's have a closer look at them.

Odoo models are represented by Python classes. In the preceding code, we have a Python class Stage, based on the models.Model class, that defines a new Odoo model called todo.task.stage.

Odoo models are kept in a central registry, also referred to as pool in the older Odoo versions. It is a dictionary that keeps references to all the model classes available in the instance, and it can be referenced by a model name. Specifically, the code in a model method can use self.env['x'] to get a reference to a class representing the model x.

You can see that model names are important since they are the keys used to access the registry. The convention for model names is to use a list of lowercase words joined with dots, such as todo.task.stage. Other examples from the core modules are project.project, project.task, or project.task.type. We should use the singular form todo.task model instead of todo.tasks. For historical reasons, it is possible to find some core models that don't follow this, such as res.users, but it is not the rule.

Model names must be globally unique. Because of this, the first word should correspond to the main application the module relates to. In our example, it is todo. Other examples from the core modules are project, crm, or sale.

Python classes, on the other hand, are local to the Python file where they are declared. The identifier used for them is only significant for the code in that file. Because of this, class identifiers are not required to be prefixed by the main application they relate to. For example, there is no problem to name our class Stage for the todo.task.stage model. There is no risk of collision with possible classes with the same name on other modules.

Two different conventions for class identifiers can be used: snake_case or CamelCase. Historically, Odoo code used the snake case, and it is still possible to find classes that use this convention. But the trend is to use camel case, since it is the Python standard defined by the PEP8 coding conventions. You may have noticed that we are using the latter form.