How To Create Dynamic Tree View In Odoo 17 - Odoo 17 Slides

CelineGeorge1 409 views 18 slides Aug 08, 2024
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

Odoo application enables the creation of custom list/tree views, allowing us to select the fields we want to include in our personalized list view. This feature facilitates the management of dynamic tree views in Odoo


Slide Content

How To Create Dynamic Tree View In Odoo Enterprise

Introduction Enterpr ise Odoo application enables the creation of custom list/tree views, allowing us to select the fields we want to include in our personalized list view. This feature facilitates the management of dynamic tree views in Odoo

Dynamic Tree View Enterprise In Odoo, the Tree View, also referred to as List View, displays multiple records in a list format consisting of rows and columns. Each row corresponds to a database table record. We can perform various operations on the Tree View, such as sorting, filtering, and grouping. All views are stored in the database.

Code Enterprise

View Enterprise

Explanation Enterprise The XML defines a tree view for the hospital.management model in Odoo, with the view ID view_hospital_tree. The view, named hospital.tree, displays fields such as name, admission_no, and age. Additionally, fields like ref_no, address, street, and phone_no are marked as optional with optional="hide", allowing users to show or hide these fields in the tree view based on their preference. This setup provides a customizable and flexible view for managing hospital data.

View Enterprise

Explanation Enterprise In Odoo, the attribute optional="hide" is used in view definitions to indicate that a particular field in a tree or list view can be optionally hidden by the user. This feature provides flexibility for users to customize their views according to their preferences and needs In this view, fields such as ref_no, address, street, and phone_no have the optional="hide" attribute. This means these fields are hidden by default in the tree view but can be displayed if the user chooses to show them.

Example Enterprise

View Enterprise

Explanation Enterprise ref_no is shown by default but can be hidden by the user (due to optional="show"). name, admission_no, and age are always shown. address, street, and phone_no are hidden by default but can be shown by the user (due to optional="hide"). The optional="show" attribute enhances user flexibility by allowing them to decide which fields they want to see or hide in their customized view.

Example(Tree view) Enterprise

View Enterprise

Explanation Enterprise This tree view configuration provides flexibility for users to customize their view of the hospital.management model. Fields like name, admission_no, and age are always visible, while ref_no and address are shown by default but can be hidden. Conversely, street and phone_no are hidden by default but can be shown. This setup enhances user experience by allowing a personalized and clutter-free interface.

View Enterprise

Explanation Enterprise In brief, a dynamic tree view allows the tree view to be expanded with fields that have the optional attribute. If the value of the optional attribute is "show," the specified fields will be displayed; otherwise, they will not be shown. Users can customize the view directly from the UI, enabling only the necessary fields by selecting them from the sidebar.

Enterprise Conclusion Hence in this way, we can set up dynamic tree view for our models for a better user experience in Odoo .

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com