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:
- Edit
todo_stage/__init__.pyto import themodelssubmodule:
from . import models
- Create the
todo_stage/modelsdirectory and add to it an__init__.pyfile with this:
from . import todo_task_tag_model from . import todo_task_stage_model
- Add the
todo_stage/models/todo_task_tag_model.pyPython code file:
from odoo import fields, models
class Tag(models.Model):
_name = 'todo.task.tag'
_description = 'To-do Tag'
name = fields.Char('Name', translate=True) 4. Then, add the todo_stage/models/todo_task_stage_model.py Python code file:
from odoo import fields, models
class Stage(models.Model):
_name = 'todo.task.stage'
_description = 'To-do Stage'
_order = 'sequence,name'
name = fields.Char('Name', translate=True)
sequence = fields.Integer('Sequence') Here, we created the two new models that will be referenced in the To...