Creating models

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:

  1. Edit todo_ui/__init__.py to import the models submodule:
            from . import models 
    
  2. Create the todo_ui/models directory and add to it an __init__.py file with this:
            from . import todo_model 
    
  3. Now let's add the todo_ui/models/todo_model.py Python code file:
     # -*- coding: utf-8 -*- from odoo import models, fields, api class Tag(models.Model): _name = 'todo.task.tag' _description = 'To-do Tag' name = fields.Char('Name', 40, translate=True) class Stage(models.Model): _name = 'todo.task.stage' _description = 'To-do Stage' _order = 'sequence,name' name = fields.Char('Name', 40, translate=True) sequence = fields.Integer('Sequence')  ...

Get Odoo 10 Development Essentials 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.