Has anyone been able to get the color attribute to work on the Product Tree View ? According to the code below , a product with a virtual_available < 0 should be in 'red' - it doesn't appear to be.
The code in ../addons/stock/product_view.xml looks like this -
<record id="view_stock_product_template_tree" model="ir.ui.view">
<field name="name">product.template.stock.tree.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="colors">{'red':virtual_available<=0, 'blue':virtual_available>=0 and state in ('draft', 'end', 'obsolete'), 'black':virtual_available>=0 and state not in ('draft', 'end', 'obsolete')}</attribute>-->
</tree>
<field name="uom_id" position="after">
<field name="qty_available"/>
<field name="virtual_available"/>
</field>
</field>
</record>
Problem Solved - see zbik answer