Improve relate domains for a better inversion on client side
Relate Action domains are usually written as:
[(field_name, 'in', Eval('active_ids'))]
This is great as we can select multiple records and open all the relates, but we lose the power of the '=' operator in domain inversion to ensure the relate value is correctly set.
So in order to improve this behaviour we can use the following expression to express domains:
If(Len(Eval('active_ids', [])) == 1),
[(field_name, '=', Eval('active_id'))],
[(field_name, 'in', Eval('active_ids'))])
All the relates should be reviewed in order to determine if they can benefit from this behaviour.
Note: Thanks to cedk which pointed it on: https://tryton-rietveld.appspot.com/30431002/diff/1/product.xml#newcode179