[FIX]: crm: Always add the To to global CC when forward that lead to any partner

bzr revid: rpa@tinyerp.com-20100719140215-q0ek406j71mynts5
This commit is contained in:
rpa (Open ERP)
2010-07-19 19:32:15 +05:30
parent 1417b374c3
commit e368981d2e
+3 -3
View File
@@ -186,13 +186,13 @@ class crm_lead_forward_to_partner(osv.osv_memory):
to_write.update({'user_id' : this.user_id.id})
email_re = r'([^ ,<@]+@[^> ,]+)'
email_cc = re.findall(email_re, case.email_cc or '')
new_cc = ''
new_cc = []
for to in this.email_to.split(','):
email_to = re.findall(email_re, to)
email_to = email_to and email_to[0] or ''
if email_to not in email_cc:
new_cc += ', ' + to
to_write.update({'email_cc' : case.email_cc and case.email_cc + new_cc})
new_cc.append(to)
to_write.update({'email_cc' : case.email_cc or '' + ','.join(new_cc)})
case_pool.write(cr, uid, case.id, to_write, context=context)
return {}