From 77c6be308100b69f6d9b83a1d43a236a32ad0b06 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 19 Aug 2010 18:28:22 +0200 Subject: [PATCH] [FIX] crm: Use the email and not the name for the From and To header, because there is a bug in the smtplib.sendmail function of python http://bugs.python.org/issue1050268 [FIX] crm: If the reply_to field is None, use an empty string to avoid the allow_none message from the xmlrpc library bzr revid: stephane@openerp.com-20100819162822-ez9chgz26n4gm124 --- addons/crm/wizard/crm_send_email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index 892b42ca460..ae4e87f30ad 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -104,7 +104,7 @@ class crm_send_new_email(osv.osv_memory): res_id = hist.res_id ref_id = hist.ref_id case = case_pool.browse(cr, uid, res_id, context=context) - emails = [obj.email_to] + emails = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_to or '') email_cc = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_cc or '') emails = filter(None, emails) body = obj.body @@ -238,7 +238,7 @@ class crm_send_new_email(osv.osv_memory): res.update({'email_cc': email_cc}) if 'reply_to' in fields: if hasattr(case, 'section_id'): - res.update({'reply_to': case.section_id.reply_to}) + res.update({'reply_to': case.section_id.reply_to or ''}) if 'state' in fields: res['state'] = u'pending' return res