Inside a form view, I have put a notebook and inside a page but I cannot show colors based on the value of a field, this is what I have but it does not paint the gray color:
<notebook>
<page name="forecast_records" string="Forecast Records">
<field name="forecast_product_ids" nolabel="1" context="{'active_rec_id':active_id}" domain="[('period_start_date','=', forecast_filter_id)]" attrs="{'readonly': [('state','in',['done'])]}">
<tree string="Forecast" editable="top" delete="false" create="false">
<field name="id" invisible='1'/>
<field name="product_id" readonly="1"/>
<field name="prestashop_product_id" readonly="1"/>
<field name="sales" readonly="1"/>
<field name="days_unavailable" readonly="1"/>
<field name="percentage_unavailable" readonly="1"/>
<field name="forecast_qty"/>
<field name="onhand_qty" readonly="1"/>
<field name="available_for_sale" readonly="1"/>
<field name="incoming_qty" readonly="1"/>
<field name="outgoing_qty" readonly="1"/>
<field name="action_qty" readonly="1"/>
<field name="action_required"/>
<field name="document_number" readonly="1"/>
<field name="procurement_id" invisible="1"/>
</tree>
</field>
</page>
</notebook>
Odoo provides some attributes for the tree tag which are:
Depending on the condition that you place, it will show you one or another color, I don't remember what colors each attribute gives but you can try them, an example of use would be like this: