Odoo Help

0

Is there a way to change text color on a specific field in list (Tree) view?

By
John Baldwin
on 2/17/15, 4:54 PM 813 views

I can change an entire row's color base on the comparison vaue of a boolean. I've done that.

<tree string="Contacts" colors="red:dnc==True">
                        <field name="display_name"/>
                        <field name="function" invisible="1"/>
                        <field name="street"/>
                        <field name="street2"/>
                        <field name="city"/>
                        <field name="state_id"/>
                        <field name="zip"/>
                        <field name="dnc"/>
                        <field name="phone"/>
                        <field name="email"/>
                        <field name="user_id" invisible="1"/>
                        <field name="is_company" invisible="1"/>
                        <field name="country_id" invisible="1"/>
                        <field name="parent_id" invisible="1"/>
                    </tree>

BUT what I really want is to change the color of just one specific field (phone) based on that boolean's value (dnc). Any ideas?

0

deep

--deep--
1695
| 5 5 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 2/18/15, 5:25 AM

No I dont think you can do it, but you can change the color for entire records based on criteria...

However, without using any criteria if you wish to set colors for few fields, then yes you can do it...

In form view, I have acheived setting color for few selected fields, by creating my own widget in js, and referenced the same against those fields using "option",

So you can also try the same, see if it works for you too in Tree view..

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: 2/17/15, 4:54 PM
Seen: 813 times
Last updated: 3/16/15, 8:10 AM