[FIX] email_template: fix invalid uses of tools.email_split

This is necessary to have the tests pass after
the corresponding server patch in server 7.0
at revision 5198 revision-id: odo@openerp.com-20140114120344-r58wndgybqusnnq7

lp bug: https://launchpad.net/bugs/1199386 fixed
lp bug: https://launchpad.net/bugs/1165531 fixed

bzr revid: odo@openerp.com-20140114134627-6j83f4s6pvnj4uma
This commit is contained in:
Olivier Dony 2014-01-14 14:46:27 +01:00
parent cc5d5bb2bf
commit a7cb9b762d
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ class test_message_compose(TestMailBase):
'body_html': '${object.description}',
'user_signature': True,
'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])],
'email_to': 'b@b.b c@c.c',
'email_to': 'b@b.b, c@c.c',
'email_cc': 'd@d.d'
})
@ -191,7 +191,7 @@ class test_message_compose(TestMailBase):
email_template.write(cr, uid, [email_template_id], {
'model_id': user_model_id,
'body_html': '${object.login}',
'email_to': '${object.email} c@c',
'email_to': '${object.email}, c@c',
'email_recipients': '%i,%i' % (p_b_id, p_c_id),
'email_cc': 'd@d',
})

View File

@ -146,7 +146,7 @@ class mail_compose_message(osv.TransientModel):
# transform email_to, email_cc into partner_ids
partner_ids = set()
mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', ''))
mails = tools.email_split(values.pop('email_to', '')) + tools.email_split(values.pop('email_cc', ''))
ctx = dict((k, v) for k, v in (context or {}).items() if not k.startswith('default_'))
for mail in mails:
partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=ctx)