Colocarle color a las líneas en un TreeView en Odoo

No Comments

Si queremos colocarle color a un treeview en Odoo usamos la siguiente sentencia

<tree string=”session List” colors=”blue:state==’draft’; green:state==’confirmed’ “>
             <field name=”name”/>
            <field name=”start_date”/>
            <field name=”duration”/>
  </tree>

Si la duración es mayor que 5

colors="blue: duration &gt; 5 "

Si es menor que 5

colors="blue: duration &lt; 15 "

Multiples condiciones

colors="blue: state in (‘confirmed’, ‘done’, ‘waiting’) ; red: state==’draft’"

haciendo negrita una fila

 <xpath expr="//tree" position="attributes">
                   <attribute name="colors">red:deprecated == True;</attribute>
                   <attribute name="fonts">bold:deprecated == True;</attribute>
 </xpath>

Marlon Falcón es Gerente general de Falcon Solutions.

Marlon Falcón Herández

Consultor SAP y Odoo

More from our blog

See all posts
 

Dejar un comentario