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

Changing background-color row tree view

By
Jose M. González
on 2/22/16, 7:42 AM 1,025 views

Hi, 

Someone knows how to change background-color of file in tree view with one condition?

Thanks

2

Parikshit

--Parikshit--
939
| 6 3 8
Ahmedabad, India
--Parikshit--

Working as an OpenERP/Odoo developer both experience in web and addons. you can contact me at:

E-mail : parikshitvaghasiya@gmail.com

Blog : parikshitvaghasiya.blogspot.in

Stackoverflow : http://stackoverflow.com/users/5089106/parikshit-vaghasiya

Parikshit
On 2/22/16, 8:48 AM

hello..


Try this in your css file...
.openerp .oe_list_content > tbody > tr:nth-child(odd) {

   background-image: linear-gradient(to bottom, #f0f0fa, #eeeef6);
}


  Hope this will help you.

1
Jose M. González
On 2/22/16, 11:06 AM

thank you ,

With This code i can change the color in the tree view but , how can i put the condition ?

for example:

if ('state' == 'draft') {

    //apply one style

} else{

    // apply other style

}

i should do it from javascript?



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

1 follower(s)

Stats

Asked: 2/22/16, 7:42 AM
Seen: 1025 times
Last updated: 2/28/16, 1:27 AM