diff --git a/addons/mail/mail_template.py b/addons/mail/mail_template.py index f73ed0cffcd..cbe309b83ff 100644 --- a/addons/mail/mail_template.py +++ b/addons/mail/mail_template.py @@ -551,11 +551,12 @@ class mail_template(osv.osv): # create a mail_mail based on values, without attachments values = self.generate_email(cr, uid, template_id, res_id, context=context) - if not values.get('email_from'): - raise UserError(_("Sender email is missing or empty after template rendering. Specify one to deliver your message")) values['recipient_ids'] = [(4, pid) for pid in values.get('partner_ids', list())] attachment_ids = values.pop('attachment_ids', []) attachments = values.pop('attachments', []) + # add a protection against void email_from + if 'email_from' in values and not values.get('email_from'): + values.pop('email_from') msg_id = mail_mail.create(cr, uid, values, context=context) mail = mail_mail.browse(cr, uid, msg_id, context=context)