openlabs/poweremail — pull request #28 by mrsarm (2012-09-09 06:05:24+00:00)
Title: [FIX] Prevent TypeError in pem_from field in OpenERP 6.1

In OpenERP 6.1, when I'm trying to send a email from a wizard (sale order), this error is launched:

Server Traceback (most recent call last):
File "/python/openerp-6.1-1/openerp/addons/web/common/http.py", line 592, in send
result = openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/python/openerp-6.1-1/openerp/netsvc.py", line 360, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/python/openerp-6.1-1/openerp/service/web_services.py", line 572, in dispatch
res = fn(db, uid, *params)
File "/python/openerp-6.1-1/openerp/osv/osv.py", line 167, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/python/openerp-6.1-1/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/python/openerp-6.1-1/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/python/openerp-6.1-1/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/python/openerp-6.1-1/extra-addons/poweremail/send_wizard.py", line 187, in send_mail
mailid = self.save_to_mailbox(cr, uid, ids, context)
File "/python/openerp-6.1-1/extra-addons/poweremail/send_wizard.py", line 233, in save_to_mailbox
'pem_from': tools.ustr(accounts['name']) + "<" + tools.ustr(accounts['email_id']) + ">",
TypeError: list indices must be integers, not str

With this fix prevent this error.