Enable Dark Mode!
list-tree-view-decoration-attributes-in-odoo-18.jpg
By: Ayana KP

List (Tree) View Decoration Attributes in Odoo 18

Technical

List view decorations in Odoo provide a way to visually highlight records or fields in the list/tree view based on specific conditions. These decorations can improve the user experience by making it easier to identify important records. In Odoo 18, several attributes can be used for list view decorations, offering flexibility in managing your data. Here’s an overview of the key decoration attributes and their usage.

In Odoo, the <list> element utilizes the decoration-type attribute to apply visual indicators to a list view based on the value of a particular field. The decoration-type attribute enables you to define a condition under which the decoration will be applied.

The syntax for using decoration attributes in a list view definition is as follows:

<list decoration-type="field=='value'">

For Example :

<list string="Next Activities"
       decoration-danger="date_deadline &lt; current_date and active == True"
       decoration-warning="date_deadline == current_date and active == True"
       decoration-success="date_deadline &gt; current_date and active == True"
       default_order="date_deadline" create="false">

1. decoration-info

The decoration-info attribute is used to highlight records in blue, typically indicating information that needs attention but isn’t critical. You can apply this decoration based on a condition.

List (Tree) View Decoration Attributes in Odoo 18-cybrosys

2. decoration-danger

The decoration-danger attribute highlights records in red, typically used to indicate a critical issue or error that requires immediate attention.

List (Tree) View Decoration Attributes in Odoo 18-cybrosys

3. decoration-success

The decoration-success attribute is used to indicate successful or positive conditions, highlighted in green. It’s commonly used for completed tasks, paid invoices, or stock levels above a threshold.

4. decoration-muted

The decoration-muted attribute allows you to gray out certain records. It’s often used to indicate inactive or archived records.

List (Tree) View Decoration Attributes in Odoo 18-cybrosys

5. decoration-warning

This attribute highlights records in yellow, indicating a warning or something that needs caution.

List (Tree) View Decoration Attributes in Odoo 18-cybrosys

7. decoration-it (Italic)

This attribute renders the field in italic text. It’s a subtler way of decorating the view, often used for less critical visual distinctions.

8. decoration-bf (Bold)

The decoration-bf attribute applies bold formatting to fields.

9.  decoration-primary 

The decoration-primary attribute is used to highlight records in light purple, typically indicating information that needs attention but isn’t critical. You can apply this decoration based on a condition.

List view decorations in Odoo 18 provide a useful tool for enhancing the visibility and management of records. By using the various decoration attributes, you can create more intuitive and informative views for your users.

To read more about Tree View Decoration Attributes in Odoo 17, refer to our blog Tree View Decoration Attributes in Odoo 17.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message