Publication Category
Odoo Development Essentials, Article #4: Adding Views Using the Odoo Developer Mode

Odoo Development Essentials, Article #4: Adding Views Using the Odoo Developer Mode

April 15, 2022

​The final installment on using the Odoo developer mode.

 

Covered in this article:

  • Creating a list view.
  • Creating a form view.
  • Creating a search view.
  • Enabling default filters on views.

The final segment of our Odoo development tutorial

In the previous article, we furthered our Odoo development expertise by digging into how to create a new model in Odoo, add corresponding security access, and how to make the new model available to users as a menu item.

Now, for the final installment of our four-article series, we’re going to sink our teeth into one last development skill to crown those we’ve acquired thus far: How to add the Form and List views for the model you created in the previous article.

Creating Views in Odoo

To summarize once more, in the last article, we created the To-do Items Model and made it available in the user interface with a Menu Item. Next, we will be creating the two essential views for it—the List and Form views.

The List view is the most basic way for users to browse existing records. In some cases, records can be edited directly in the List view, but the most common case is to navigate to a Form view when clicking on a record, and do the data editing there.

Creating a List View

We can manage Views at Settings | Technical | User Interface | Views. Click on the Create button and enter the following values:

  • View Name: To-do List View
  • View Type: Tree
  • Model: x_todo_item
  • Architecture tab: Should contain the XML for the view structure. Use the following XML code:

 

This is what the View definition should look like:

Creating a list view

Odoo 15 Development Essentials

This series of articles was extracted from the first chapter of Odoo 15 Development Essentials. The succeeding chapters of the book contain much more valuable Odoo development information, available for purchase here.

Learn more about the book, its content, and its author at https://authors.packtpub.com/interview-with-daniel-reis/.

 

Happy Odooing!

Odoo 15 Development Essentials
Image
Daniel

About the author

Daniel is a seasoned IT professional with extensive experience implementing business applications across a broad range of sectors. He’s worked with Odoo since 2010, back when it was known as Open ERP, and serves as a board member for the Odoo Community Association (OCA). Daniel is the managing director of Open Source Integrators.

Get Started

Take the next step to connect with us and discover the power of Odoo. We look forward to speaking with you!