Hi,
I would like to create an e-mail template for a custom model.
the model hast 2 fields. One field many2One to a party.party and one field Many2Many towards party.party.
In the e-mail template I am offered to add a field for “recipients”. When clicking, it offers me only the many2one field, the created_by, edited_by but not the may2many.
Is there a way to add the Many2many partys as recipients?
Or is there a different approach?
I saw that there is the possibility to use a PYSON STatement in the char field. I tried with Eval("self.parents", []), where parents is the m2m field linking party.party. But it seems to return an empty list.
Is it possible that way and i am just having a mistake i the statemet or does that not work at all?
Do you have a hint for me, how to create that pyson statement, please? (self.parents,[] ) Does not give me a result, but in Trytond-console I can navigate to the model “member”, that should be the model in “self” and get two party-records with member.parents.
Unfortunately that does not give a result. The statement is rewritten to Get(Eval("self", {}), "parents", []) when saving the object.
When I use the template from the member model of the cliental- , it does not pull the values.
I double checked in the Trytond-Console:
In case, someone else has that problem.
I read somewhere else in the forum, the statement must return a list of strings containing e-mail addresses. I read as well, that iteration over al list of objects I pyson Is not possible.
I now create a Function Field on_change_with depending on the m2m field, that extracts a char list of