From 27686df49d8f438c41b90866cedd921989252461 Mon Sep 17 00:00:00 2001 From: chirag patel Date: Mon, 29 Apr 2013 17:34:09 +0530 Subject: [PATCH] [FIX] Fixed raise warning when email_from value false. bzr revid: cpa@tinyerp.com-20130429120409-sm0c01022qm25agv --- addons/email_template/email_template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 356d903b03d..e8f9dbba5a4 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -376,7 +376,8 @@ class email_template(osv.osv): # create a mail_mail based on values, without attachments values = self.generate_email(cr, uid, template_id, res_id, context=context) - assert values.get('email_from'), 'email_from is missing or empty after template rendering, send_mail() cannot proceed' + if not values.get('email_from'): + raise osv.except_osv(_('Warning!'),_('email_from is missing or empty after template rendering, send_mail() cannot proceed')) del values['email_recipients'] # TODO Properly use them. attachment_ids = values.pop('attachment_ids', []) attachments = values.pop('attachments', [])