[FIX] base_action_rule: Escape the emails

bzr revid: stephane@openerp.com-20100908113656-36zshoam6klxxznr
This commit is contained in:
Stephane Wirtel 2010-09-08 13:36:56 +02:00
parent b65288b127
commit 3b13de26ae
1 changed files with 6 additions and 1 deletions

View File

@ -363,7 +363,12 @@ the rule to mark CC(mail to any other person defined in actions)."),
'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
'obj' : obj,
})
self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_from)
def to_email(text):
return re.findall(r'([^ ,<@]+@[^> ,]+)', text or '')
emails = to_email(','.join(filter(None, emails)))
email_froms = to_email(email_from)
if email_froms:
self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_froms[0])
return True
def _action(self, cr, uid, ids, objects, scrit=None, context=None):