Decoration Attributes used in List (Tree) View in Odoo 18
Odoo’s list view decorations offer a way to highlight particular records or fields in the list/tree view according to certain criteria. To visually recognize records or fields in the list/tree view based on specific conditions, Odoo offers list view decorations. Because they make it simpler for users to understand the crucial records, these can improve the user experience. Using a variety of attributes in list view decorations, Odoo 18 gives you flexibility in how you handle your data. An overview of the primary decorating traits and their applications may be found here.
<list decoration-type=”your_field==’value'”></list>
For Example :
<list string="Task List"
decoration-danger="priority == '3' and active == True" decoration-warning="priority == '2' and active == True" decoration-success="priority == '1' and active == True" decoration-muted="active == False" default_order="priority desc" create="true">
</list>
1. decoration-danger
The decoration-danger attribute marks the records with a critical problem or error that requires correction immediately with a red colour using decoration.
2. decoration-info
Usually, records that need attention but are not time-sensitive are in blue with the decoration-info attribute. You would often use this decoration based on what you want to put out in an application.
3. decoration-muted
While decoration-muted is used to grey out selected records, this is predominantly an indicator that a record is archived or inactive.
4. decoration-success
The decoration-success attribute usually depicts a scene that is either favourable or successful circumstances. It is filled in green and becomes quite commonly used on completed projects, billed bills, or where stock levels have exceeded a certain threshold.
5. decoration-warning
This decorator places yellow highlights on those records that you should be cautious about or those that are cautionary.
6. decoration-bf (Bold)
The fields are bolded while making use of the decoration-bf property.
8. decoration-primary
Records that need attention but are not of high critical concern are usually highlighted in light purple using the decoration-primary property. You can make use of this decoration based on the requirements of the situation.
9. decoration-it (Italic)
This property makes the field italic. It’s one of those dumber ways of styling your view and is used very often for less impactful changes on the view.
List view decorations in Odoo 18 help improve the management and visibility of records. You can make the views more user-friendly and educational by making use of the different decoration attributes.
"Unlock the Full Potential of Your Business with Odoo ERP!"
"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"
Get a Free Quote