Hi,
The following code returns me empty set, I guess it depends on when the Pyson domain is evaluated but I’m not sure.
....
party = fields.Many2One('party.party', 'Party',
states={
'invisible': Eval('type') != 'project',
}, depends=['type'])
parties = fields.Many2Many('project.work-address.relation',
'project', 'relation', 'Related Parties',
states={
'invisible': Eval('type') != 'project',
},
domain=[
('from_', 'in', Eval('_parent_party.addresses', [])),
],
depends=['type'])
...
I tested the Pyson and it seems to work …
...
>>> t = Eval('_parent_party.addresses')
>>> PYSONDecoder(env).decode(PYSONEncoder().encode(t))
[11, 12]
While the following code works
party = fields.Many2One('party.party', 'Party',
states={
'invisible': Eval('type') != 'project',
}, depends=['type'])
parties = fields.Many2Many('project.work-address.relation',
'project', 'relation', 'Related Parties',
states={
'invisible': Eval('type') != 'project',
},
domain=[
('from_', 'in', [11, 12]),
],
depends=['type'])
...
A suggestion/idea ?
Thanks a lot.