Community mailing list archives

community@mail.odoo.com

Error on Automatic Emails

by
Dave Ellison
- 03/11/2016 06:49:17
Hi,

I have an automated action, that emails some information out. So all 
works ok, if I hardcode the "to" email address in the server action 
(action type email) my address, it works fine. This is just my email 
address not:

Dave Ellison <myname@mydomain> RFC style

But if I used an expression [[ object.partner_id.email ]], it sees it as 
a list and not a string, giving me the error:

   File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py", line 330, in build_email
     msg['To'] = encode_rfc2822_address_header(COMMASPACE.join(email_to))
TypeError: sequence item 0: expected string, list found



So, guessing that just that expression alone is returning a list, I 
added in some text either side. Worked fine, but now sees it as an 
invalid email address.

Anyone had this issue or know what I am doing wrong?

Thanks
Dave