Odoo 17 Tree View Configuration

January 7, 2026 by
Odoo 17 Tree View Configuration
Widuri Sugiyani
| No comments yet

Continuing our exploration of Odoo XML, now let's dive into Odoo Tree view Configuration. If you've worked with Odoo, you know that tree views (or list views) are where users spend most of their time—viewing records, managing data, and making decisions. Configuring an Odoo tree view involves customizing how records are displayed in list format. In this blog we'll see what is mostly used configuration in tree view Odoo, its purpose and the example.


The Basics: Essential Attributes Configuration Every Developer Should Know


1. Intelligent Sorting with default_order


<tree default_order="date desc">

The default_order attribute is your first tool for creating user-friendly interfaces. It determines how records are sorted when the view first loads.

Common Use Cases

Use CaseExampleWhy It Matters
Recent Firstdefault_order="create_date desc"Users typically want to see newest records first
Priority-Baseddefault_order="priority desc, deadline asc"Critical items appear at the top
Alphabeticaldefault_order="name asc"Easy scanning for names or codes
Sequentialdefault_order="sequence asc"For manually ordered lists
  • Users can still click column headers to change sorting
  • The default_order is the initial state when the view loads
  • Use asc (ascending) or desc (descending)


2. Controlling Record Creation with "create"


<tree create="1"> <!-- Creation allowed --> <tree create="0"> <!-- Creation disabled -->

The create attribute controls whether users can add new records directly from the list view.

Value and behavior

ValueCreates Button?Create Action?Description
"1" or "true"✅ Yes✅ YesFull creation access (default)
"0" or "false"❌ No❌ NoNo creation allowed


3. Protecting Data with "delete"


<tree delete="1"> <!-- Deletion allowed --> <tree delete="0"> <!-- Deletion disabled -->

The delete attribute controls whether users can remove records from the tree view.

Value and behavior

ValueDelete Button?Delete Action?Description
"1" or "true"✅ Yes✅ YesFull delete access (default)
"0" or "false"❌ No❌ NoNo deletion allowed


4. Smart Editing with "editable"


<tree editable="bottom"> <!-- New at bottom --> <tree editable="top"> <!-- New at top -->

The editable attribute determines how and when users can edit records directly in the tree/list view, without opening the full form view.

When to use each mode

ModeBest ForExample
editable="bottom"General data entry, order lines, listsSales order lines, invoice lines
editable="top"Chronological entries, latest-firstNews items, activity streams, logs


5. Grouping Data with "default_group_by"


<tree default_group_by="category_id" expand="1">

This configuration is used to automatically group records in a tree (list) view when the view is opened.Instead of showing a flat list of records, Odoo organizes them into logical groups based on a field in this case, category_id.

The expand Attribute: 

  • expand="1" - All groups open by default 
  • expand="0" - All groups closed by default


6. Import Control


<tree import="0">

The Import Control configuration in an Odoo tree (list) view is used to control whether users can import data into a model from the list view.


Conclusion


Odoo tree (list) views are more than just a way to display records—they are a powerful interface where users interact with data every day. By understanding and properly configuring tree view attributes, developers can significantly improve usability, data safety, and overall user experience.

Attributes like default_order and default_group_by help present data in a logical and meaningful way from the moment the view loads. Controls such as create, delete, and editable allow you to balance flexibility with data protection, ensuring users can work efficiently without risking unwanted changes. Meanwhile, features like inline editing and controlled imports streamline daily operations and reduce unnecessary navigation.

In short, mastering tree view configuration enables you to build cleaner, smarter, and more user-friendly Odoo applications. Instead of relying on custom code, many common requirements can be solved simply by choosing the right tree view attributes. As an Odoo developer, knowing when and how to use these options is a key step toward creating maintainable and professional solutions.

Odoo 17 Tree View Configuration
Widuri Sugiyani January 7, 2026
Share this post
Archive
Sign in to leave a comment