Hi, Im trying to hide the field called vat if the field supplier is true, but I don't know what I'm doing wrong
Here is my code, I'm able to hide the field but can't do it with the if condition on the supplier field.
Thank you in advance
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_new_sale_form">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='vat']" position="attributes">
<t t-if="docs.supplier == true">
<attribute name="invisible">True</attribute>
</t>
</xpath>
</field>
</record>
</odoo>
Correct code after answers:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_new_sale_form">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='vat']" position="attributes">
<attribute name="attrs">{'invisible': [('supplier','=',True)]}</attribute>
</xpath>
</field>
</record>
</odoo>