Help

3

How to color fields in form view?

Avatar
onkar

I m trying to find a solution to give color to fields in form view. For now i have given color to the label .

But i also want to color the value that is there for that field.Is there any widget that i can use to get color or do i have to create a css for it.

Avatar
Discard
3 Answers
2
Best Answer

You can just use inline css to get your goal
Like:

<field name="operator" style="background:Blue;" attrs="{'readonly':[('state', '=', 'done')]}"/>

if you need to give color for your letters, then use style="color:Red;" 

1 Comment
Avatar
Discard
Avatar
Community Question
-

Note: For W3C compliant CSS: If you define the color property, you must also define the background-color. I needed to do this with Odoo v11.

0
Best Answer

Hi ,

For that you need to create css and give the class name to the field.

ex: In Css file

.text_value_color {

    color: #052EF9;

}

In xml :

<field name="name" class="text_value_color"/>

Avatar
Discard