[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user