I'm having a little problem while defining a domain filter on a sale.order.form
I'm on a sale.order and I wanna update a domain filter for the field 'partner_invoice_id'. Reason is hiding the invoice address if it is the same as the partner id. So if partner_id == partner_invoice_id hide the field.
The error message is: ValueError: Invalid leaf [6, u'!=', 6]. What is wrong with that?
This is the code:
<xpath expr="//field[@name='partner_invoice_id']" position="attributes">
<attribute name="parent_id">id</attribute>
<attribute name="readonly">1</attribute>
<attribute name="context">{'show_address': 1,'default_type':'invoice','partner_id':partner_id}</attribute>
<attribute name="options">{"always_reload": True}</attribute>
<attribute name="domain">
['&', ('type', 'in', ['default', 'invoice', 'contact', 'other']),
'&', (bool(partner_id), '=', True),
'&', (bool(partner_invoice_id), '=', True),
'&', (partner_id, '!=', partner_invoice_id), <!-- this doesn't work. If I remove this, my form will work
'|', ('id', '=', partner_id), ('parent_id', '=', partner_id)]
</attribute>
<attribute name="widget">selection</attribute>
</xpath>