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.

1

How to change color of line in tree view

By
John Pia Jr
on 6/24/14, 2:38 PM 9,586 views

Hello,

I need to know hwot ochange the color of a line (record) in a tree view based on if there is any content within the notes field of the form.. 

 

Example

I want the line text to change to red inf there are any notes in the notes field on a specific delivery order. How can I do this? something like 

if notes != '' then ...

3

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 6/24/14, 8:59 PM

<tree colors="red:notes!=False'">

Take a look at an existing XML definition of a treeview that uses colors for more help.


 

I want to change the color of Particular column in tree view. Please help me.

for eg. Change the background color of amount in sale order tree view.

Chandni
on 11/16/16, 4:42 AM
4

Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
3577
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 6/25/14, 12:35 AM

Hi, try this example...

In py file

'status' : fields.selection([('single','Single'),('married','Married')],'Status?'),

In xml file

<tree string="Status" colors="red:shop=='single';green:shop=='married' "> <field name="name"></field> <field name="status"></field> </tree>

What is Shop ? Is it field?

Chandni
on 11/17/16, 7:45 AM
0

tolstoj

--tolstoj--
899
| 6 5 8
Germany
--tolstoj--

hi

tolstoj
On 6/24/14, 3:01 PM

I would make it with custom web module.

JS: RPC call with list of ID's from each row from listview

Python controller: response with list of ID's what have note field not empty.

JS: change color for this ID's

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

3 follower(s)

Stats

Asked: 6/24/14, 2:38 PM
Seen: 9586 times
Last updated: 11/16/16, 4:42 AM