[FIX]: crm: Fixed problem of sending mail to CC separated by semicolon
authorrpa (Open ERP) <rpa@tinyerp.com>
Thu, 15 Jul 2010 12:46:23 +0000 (18:16 +0530)
committerrpa (Open ERP) <rpa@tinyerp.com>
Thu, 15 Jul 2010 12:46:23 +0000 (18:16 +0530)
bzr revid: rpa@tinyerp.com-20100715124623-rpb7ut4tv9n7ql5p

addons/crm/crm_lead.py
addons/crm/wizard/crm_send_email.py

index 5c7fdb0..f7d551e 100644 (file)
@@ -117,7 +117,7 @@ class crm_lead(osv.osv, crm_case):
                              Defines responsible user and e-mail address for the mail gateway.'),
         'create_date': fields.datetime('Creation Date' , readonly=True),
         'email_cc': fields.text('Watchers Emails', size=252 , help="These \
-addresses will receive a copy of the future e-mail communication between partner \
+addresses(Comma-separated) will receive a copy of the future e-mail communication between partner \
 and users"),
         'description': fields.text('Notes'),
         'write_date': fields.datetime('Update Date' , readonly=True),
index 58aa729..022f987 100644 (file)
@@ -26,6 +26,7 @@ from tools.translate import _
 import base64
 import itertools
 import tools
+import re
 
 class crm_send_new_email_attachment(osv.osv_memory):
     _name = 'crm.send.mail.attachment'
@@ -105,7 +106,7 @@ class crm_send_new_email(osv.osv_memory):
                 ref_id = hist.ref_id
                 case = case_pool.browse(cr, uid, res_id, context=context)
             emails = [obj.email_to]
-            email_cc = obj.email_cc and  obj.email_cc.split(',') or ''
+            email_cc = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_cc)
             emails = filter(None, emails)
             body = obj.body