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 models

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

Let's add the following code to the todo_ui/todo_model.py file:

# -*- coding: utf-8 -*-
from openerp import models, fields, api

class Tag(models.Model):
    _name = 'todo.task.tag'
    name = fields.Char('Name', 40, translate=True)

class Stage(models.Model):
    _name = 'todo.task.stage'
    _order = 'sequence,name'
    _rec_name = 'name'  # the default
    _table = 'todo_task_stage'  # the default
    name = fields.Char('Name', 40, translate=True)
    sequence = fields.Integer('Sequence')

Here, we created the two new Models we will be referencing in the to-do tasks.

Focusing on the task stages, we have a Python class, Stage, based ...

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