- Odoo 11 Development Essentials(Third Edition)
- Daniel Reis
- 428字
- 2021-08-27 19:32:46
Introducing the todo_stage module
In the previous chapter, we created an app for personal To-Do items. Now we want to take our app to the next level by improving its user interface, including a kanban board. The kanban board is a simple workflow tool that organizes items into columns, where these items flow from the left-hand column to the right, until they are completed. We will organize our tasks into columns, according to their stages, such as Waiting, Ready, Started, or Done.
We will start by adding the data structures to enable this vision. We need to add stages, and it will be good to add support for tags as well, allowing the tasks to be categorized by subject. In this chapter, we will focus on the data models only. The user interface for these features will be discussed in Chapter 9, Backend Views - Design the User Interface, and Kanban views in Chapter 10, Kanban Views and Client-Side Qweb.
The first thing to figure out is how our data will be structured so that we can design the supporting models. We already have the central entity: the To-Do task. Each task will be at one stage at a time, and tasks can also have one or more tags on them. We will need to add these two additional models, and they will have these relationships:
- Each task has a stage, and there can be many tasks in each stage
- Each task can have many tags, and each tag can be attached to many tasks
This means that tasks have a many-to-one relationship with stages, and a many-to-many relationship with tags. On the other hand, the inverse relationships are that stages have a one-to-many relationship with tasks and tags have a many-to-many relationship with tasks.
We will start by creating the new todo_stage module and add the To-Do stage and To-Do tag models to it.
We've been using the ~/odoo-dev/custom-addons/ directory to host our modules. We should create a new todo_stage directory inside it for this new addon module. From the shell, we can use the following commands:
$ cd ~/odoo-dev/custom-addons $ mkdir todo_stage $ cd todo_stage
We begin by adding the __manifest__.py manifest file, with this content:
{ 'name': 'Add Stages and Tags to To-Dos', 'description': 'Organize To-Do Tasks using Stages and Tags', 'author': 'Daniel Reis', 'depends': ['todo_app'],
}
We should also add an __init__.py file. It is perfectly fine for it to be empty for now.
Now we can install the module in our Odoo work database and get started with the models.
- Excel從小白到小能手
- Word/Excel 2016商務(wù)辦公實戰(zhàn)從新手到高手
- Office 2016三合一職場辦公效率手冊
- 計算機(jī)聯(lián)鎖圖冊(第二版)
- Office 2016從新手到高手
- 對比Excel,輕松學(xué)習(xí)Python報表自動化
- Word綜合應(yīng)用簡明教程
- AIGC高效辦公:Excel數(shù)據(jù)處理與分析(微課版)
- 零基礎(chǔ)入門Python游戲
- Word、Excel 行政與文秘高效辦公必備
- PowerPoint 2010精美幻燈片制作
- 情感化PPT設(shè)計(微視頻版)
- Word 2007辦公應(yīng)用融會貫通
- Office辦公軟件案例教程(第4版)
- Excel 2010表格處理直通車