On 2017-03-10 00:19, Peter Müller wrote:
> Hi,
> 
> I try to put a reference from a party to a party. The referenced party will 
> be the party that will pay the invoices.
> 
> The field on the form is made as widget="selection".
> 
> I don't want that the user can select the same party as the refernced 
> party. So I want to apply the domain to show all parties, but the current. 
> 
> Probably I have wrong the Eval expression and cannot found further 
> documentation.
> 
> Regards.
> 
> from trytond.model import fields
> from trytond.pool import PoolMeta
> from trytond.pyson import Eval
> 
> __all__=['Party']
> 
> __metaclass__ = PoolMeta
> 
> 
> class Party:
>     __name__ = 'party.party'
>     payer = fields.Many2One('party.party','Payer',domain=[('code','!=',Eval(
> 'code'))])

And what is not working?
For me, you have just forgot to add 'code' to depends.
And instead of 'code', you could use 'id'.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170310085628.GI87763%40tetsuo.

Reply via email to