Hi,
I've added a supplier number and a customer number, and now I need to add this number in the tree view but I just want that the "Supplier number " appears if there is a partner is a supplier or in the view. I'll try to explain with images.
In this case when a partner is both(supplier and a costumer), it's ok to look like this:
In this case I didn't want to show the Supplier Number:
And in this case I didn't want to show the Client Number:
I'm using this code:
<record id="view_partner_tree_inherit" model="ir.ui.view">
<field name="name">res.partner.tree.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="arch" type="xml">
<xpath expr="/tree/field[@name='name']" position="after">
<field name="supplier" invisible="1"/>
<field name="customer" invisible="1"/>
<field name="n_client" attrs="{'invisible':[('customer','!=',True)]}"/>
<field name="n_supplier" attrs="{'invisible':[('supplier','!=',True)]}"/>
</xpath>
</field>
</record>
Someone know how to hide the columns depending on if it is a Suppliers tree view or a Customers tree view ?
Thanks