Community mailing list archives

community@mail.odoo.com

Re: Error on Automatic Emails

by
Dave Ellison
- 03/11/2016 11:59:54
Hi,

I worked it out, messed up on the field for the email. It does not require an expression e.g. [[ object.email ]], its just object.email without the [[ ]].

Thanks
Dave

On 11/03/16 16:16, omar frikha wrote:
encoding your message in UTF-8

2016-03-11 13:16 GMT+01:00 Dave Ellison <dave.e@time-tele.com>:
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

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe