Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

Hi,

I have configured an Automated Action with the model "hr.contract", and in the Server Actions i created one where the action to execute is "Send Email" and i created a Email Template with variables using ${object.XXXXX} where XXXXX depends of the field that i want to show, in the Server Action i created a button that appears in the "More" menu of the model "hr.contract", when i execute this new button, the Email was sent perfectly, but when the Server Action is triggered by the Automated Action the Email was sent but the variables are not replaced with the values of the object.

I changed the Server Action where the action to do is "Execute Python Code", and in the box "Python Code" i put this:

active_id = context.get('active_id')
self.pool.get('email.template').send_mail(cr, uid, 16, 1, False, context=context)

Where 16 is the ID of the "Email Template" and 1 is the ID of one contract, then i execute again the Server Actions with the button of the "More" options in the "hr.contract" model and the Email was sent perfectly, but when is executed by the Automated Action the Email was sent without the variables changed.

¿Any idea in what i need to do?

Best regards,

Juan David López

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
kwi 24
2052
2
sty 24
4252
2
sty 24
9925
1
wrz 23
1931
0
paź 24
6553