![Odoo 12 Development Essentials](https://wfqqreader-1252317822.image.myqcloud.com/cover/30/36699030/b_36699030.jpg)
上QQ阅读APP看书,第一时间看更新
List views
We will now create a list view:
- In Settings, navigate to Technical | User Interface | Views and create a new record with the following values:
-
- View Name: To-do List View
- View Type: Tree
- Model: x_todo_item
This is how the View definition is expected to look like:
![](https://epubservercos.yuewen.com/5E3ABF/19470383408833406/epubprivate/OEBPS/Images/a8976c40-9986-4487-9fa3-49afe1620aa1.png?sign=1739288323-XLMHlIlz9oyeyhgvYh2xazEJk1UClrNW-0-b29d0b27763a65a0077d27ae24aeddd1)
- In the Architecture tab, we should write XML with the view structure. Use the following XML code:
<tree>
<field name="x_name" />
<field name="x_is_done" />
</tree>
The basic structure of a list view is quite simple—a <tree> element containing one or more <field> elements for each of the columns to display in the list view.
We can do a few more interesting things with list views, and will explore them in more detail in Chapter 10, Backend Views – Design the User Interface.