For example I would like to retrieve a field behind a Many2One, for example the email field of the party from a sale, to fill in the recipient field of an email template (I know that I can do this by selecting the field party directly, but I’d like to do it in Pyson to understand the syntax).
I tested [Eval ('party.email', '')] : it doesn’t return anything [Eval ('self.party.email', '')] : I have an error: Fault: ‘int’ object has no attribute ‘get’
This is because we use EvalEnvironment in place of self. So the relation fields are evaluated with their id. This limits a lot the possibilities so I think we should use directly the record.
I do not think so because it is a PYSON expression.
I guess you must write: [Eval('self._parent_party.email', '')]
This is because the prefix _parent_ is evaluated with a new EvalEnvironment instead of just id.
Ok, and for example to reach the name field of the account receivable of a party (self.party.account_receivable.name) i must write: Eval('self._parent_party._parent_account_receivable.name', '') ?