Odoo Help


how to give css class for treeview field in openerp ?

on 1/9/14, 2:08 AM 7,524 views


I have some doubts which are related to tree view in open erp. I want one column of tree view in blue color.

I have mentioned class attribute infront of field in tree view. e.g. in tree view i have declared field like

         <field name="partner_id" class="oe_partner_name_blue">

and class "oe_partner_name_blue" i have added in respected css file which make field font color to blue.

If i have used same class in form view it works fine. but in tree view how i should get partner_id column in blue color ?


Timo Talvitie, Vizucom Oy

--Timo Talvitie, Vizucom Oy--
| 5 4 7
Tampere, Finland
--Timo Talvitie, Vizucom Oy--

Lead developer at Vizucom.

Timo Talvitie, Vizucom Oy
On 1/9/14, 4:38 AM

If you use Google Chrome's "inspect element" to look at a treeview's field, there is the following definition:

Inherited from div.openerp_webclient_container
.openerp {
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
color: #4c4c4c;
font-size: 13px;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);

Maybe this is overwriting your own definition, have you tried if putting !important after your font color declaration in the CSS file helps? It will not affect other views.

.oe_partner_name_blue { 
    color: #0000FF!important; 

Thanx @Timo, but that will affect on all tree views.I want this for only customer tree view not for others.

on 1/9/14, 7:11 AM

I mean like this: .oe_partner_name_blue { color: #0000FF!important; }

Vizucom Oy, Timo Talvitie, Vizucom Oy
on 1/9/14, 7:26 AM
On 2/18/14, 10:29 AM

Hi @vaibhav,

Try to do so on your custom css file


[data-id="my_field"]====> for a specific th tag and [data-field="my_field"] ====>for specefic td tag

Sylvain LE GAL
On 2/18/14, 4:35 PM

You can do it with data-id AND setting a name of the class attributes of the parent tree.

See this question for an example about how to change the width of a specific column. https://accounts.openerp.com/forum/Help-1/question/35981#39782


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.


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

0 follower(s)


Asked: 1/9/14, 2:08 AM
Seen: 7524 times
Last updated: 3/16/15, 8:10 AM