Odoo Help

Welcome!

This community 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.

0

how to give css class for treeview field in openerp ?

By
Vaibhav
on 1/9/14, 2:08 AM 5,324 views

Hello,

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 ?

1
Timo Talvitie
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.

Vaibhav
on 1/9/14, 7:11 AM

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

Vizucom Oy, Timo Talvitie
on 1/9/14, 7:26 AM
0
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

Regards.

0
ZEeineb
On 2/18/14, 10:29 AM

Hi @vaibhav,

Try to do so on your custom css file

[data-id="partner_id"]
{
    background-color:#EEEEEE;
}
[data-field="partner_id"]
{
   background-color:#EEEEEE;
}

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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