Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

When a Automated Action execute a Server Action that send email from email template, the variables are not changed and not appear in the email

By
Juan Lopez
on 1/9/15, 7:34 PM 811 views

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/9/15, 7:34 PM
Seen: 811 times
Last updated: 3/16/15, 8:10 AM