Odoo Help

1

How to color a field in tree view?

By
MALLE SOULEYMANE
on 5/26/14, 8:20 AM 2,742 views

Hi, I want to know how to color a field in the tree view list?

Example: to color in red the field my_field

1

Hi, use the below example code...

In py file

'status' : fields.selection([('single','Single'),('married','Married')],'Status?'),

In xml file

<tree string="Status" colors="red:shop=='single';green:shop=='married' ">

<field name="name"></field>

<field name="status"></field>

</tree>

This will colour the whole line, not one single field.

René Schuster
on 5/26/14, 8:39 AM
0
MALLE SOULEYMANE
On 5/26/14, 11:18 AM

Ok thanks, but in this way, the line will be colored in green or red. I want this: name will be colored in green and status in red for example. Thanks

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/26/14, 8:20 AM
Seen: 2742 times
Last updated: 3/16/15, 8:10 AM