This question has been flagged
1 Reply
3759 Views

we would like to change the tree view record colour based on some condition for all module that's way we need solution through python function.example like in XML file 

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

<field name="name"></field><field name="status"></field>

</tree>

Avatar
Discard
Best Answer

from openerp import models, fields, api, _

class Attend(models.Model):

_name="attend.details"

emp_desg=fields.Selection([('md','Managing Director'),('jt','Junior Trainee'),('so','Senior Officer')],string="Department:")

------------------------------


<tree string="Attendance" version="7.0" colors="blue:emp_desg=='md';green:emp_desg=='jt'">

     Here define your all fields.

</tree>


i hve one selection. based on the selection values, that tree view record line color will be change.




Avatar
Discard