On 28/11/11 21:25 +0100, Udo Spallek wrote:
> Hi,
> 
> on the migration to 2.2 I have a problem with reverse domains.
> In my 1.8 code I could use a structure like this. But this no longer
> works in Tryton 2.2 (see ###):
> 
> class Test(ModelSQL, ModelView):
>     _name = 'test.test'
> 
>     contact_person = fields.Many2One('party.party', 'Contact Person',
>         required=True, domain=[
>             ('party_type', '=', 'person'),
> 
> ### The following clause does no longer work in 2.2
> ### When I create a new party from within field contact_person,
> ### the field organization_members is filled with the correct 
> ### party from the context [1] but I can not save the record.
> ### In the client, the field stays colored red like an 
> ### unsatisfied required.
> 
>             ('organization_members', 'in', [Eval('party'),]),
>         ], context={
>             'organization_members': Eval('party'),
>         }, states={
>             'readonly': Not(Equal(Eval('state'), 'draft')),
>         }, depends=['party', 'state'])

For me, the issue is the implementation of the operator in in
domain_invertion. It works correctly with many2one fields but not with
xxx2many.

Here is a patch: http://codereview.tryton.org/186004

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpJuYA5jrKQF.pgp
Description: PGP signature

Reply via email to