Hi,
I want to color a field in sale order line when the product category is for example = FOURNITURES
I did it with the product type and it worked fine but when I do the same with product category nothing happens
Here is my code :
Python :
product_categ_id = fields.Many2one(related='product_id.product_tmpl_id.categ_id', string='Catégorie')
XML :
<?xml version="1.0"?>
<odoo>
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.type.line</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="product_type_id" invisible="1"/>
<field name="product_categ_id" invisible="1"/>
</xpath>
</field>
</record>
</odoo>
<field name="name" decoration-info="product_categ_id == 'FOURNITURES'" decoration-warning="product_categ_id == 'All'"
It should look like this :
https://i.imgur.com/f8kesac.png
Thanks in advance