An alternative way with more details on making the field invisible, readonly, etc. simultaneously based on a specific condition.
<xpath expr="//field[@name='partner_id']" position="attributes"> <attribute name="attrs">{'invisible': [('field_name', 'Operator', Value)], 'readonly': [('field_name', 'Operator', Value)]} </attribute> </xpath>
source share