diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index d49594f4a60..3e3e7e14b3d 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -513,7 +513,7 @@ property or property parameter."), sub, body, model='calendar.attendee', - attach=attach and [('invitation.ics', attach)] or None, + attach=attach and {'invitation.ics': attach} or None, subtype='html', reply_to=email_from ) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index f6b3a20c138..0c84820b5fa 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -479,12 +479,12 @@ class crm_case(object): body = self.format_body(body) - attach_to_send = None + attach_to_send = {} if attach: attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', case.id)]) attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname', 'datas']) - attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send) + attach_to_send = dict(map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send)) # Send an email subject = "Reminder: [%s] %s" % (str(case.id), case.name, ) diff --git a/addons/event/event.py b/addons/event/event.py index 5e757d02903..b019645381e 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -548,10 +548,6 @@ class event_registration(osv.osv): body = regestration.event_id.mail_confirm if subject or body: email_message_obj.schedule_with_attach(cr, uid, src, email_to, subject, body, model='event.registration', email_cc=email_cc, openobject_id=regestration.id) - self.history(cr, uid, [regestration], subject, history = True, \ - email=email_to, details=body, \ - subject=subject, email_from=src, \ - email_cc=', '.join(email_cc)) return True diff --git a/addons/mail/email_message.py b/addons/mail/email_message.py index 39d5d8f9a8f..137cddcd8a9 100644 --- a/addons/mail/email_message.py +++ b/addons/mail/email_message.py @@ -313,7 +313,7 @@ class email_message(osv.osv): msg_txt['message-id'] = message_id _logger.info('Parsing Message without message-id, generating a random one: %s', message_id) - + fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = message_id @@ -424,7 +424,7 @@ class email_message(osv.osv): subtype=message.sub_type, x_headers=message.headers and eval(message.headers) or {}, priority=message.priority) - res = smtp_server_obj.send_email(cr, uid, + res = smtp_server_obj.send_email(cr, uid, msg, mail_server_id = message.smtp_server_id.id or None, smtp_server=smtp_server and smtp_server.smtp_host or None, diff --git a/addons/mail/wizard/email_compose_message.py b/addons/mail/wizard/email_compose_message.py index b9e11160510..b85614b6256 100644 --- a/addons/mail/wizard/email_compose_message.py +++ b/addons/mail/wizard/email_compose_message.py @@ -208,10 +208,10 @@ class email_compose_message(osv.osv_memory): def save_to_mailbox(self, cr, uid, ids, context=None): email_ids = [] email_message_pool = self.pool.get('email.message') - attachment = [] + attachment = {} for mail in self.browse(cr, uid, ids, context=context): for attach in mail.attachment_ids: - attachment.append((attach.datas_fname, attach.datas)) + attachment[attach.datas_fname] = attach.datas references = False message_id = False if context.get('mail',False) == 'reply' and mail.message_id: diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index b10368d191f..c42ddde157c 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -402,7 +402,7 @@ class survey_question_wiz(osv.osv_memory): response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response'] context.update({'response_id':response_id}) report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context) - attachments = [] + attachments = {} file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf") file_data = "" while 1: @@ -411,7 +411,7 @@ class survey_question_wiz(osv.osv_memory): if not line: break - attachments.append((survey_data.title + ".pdf",file_data)) + attachments[survey_data.title + ".pdf"] = file_data file.close() os.remove(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf") user_email = False diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py index a4638e3dd04..e86f1970b45 100644 --- a/addons/survey/wizard/survey_send_invitation.py +++ b/addons/survey/wizard/survey_send_invitation.py @@ -119,7 +119,7 @@ class survey_send_invitation(osv.osv_memory): res_user = "" user_exists = False new_user = [] - attachments = [] + attachments = {} current_sur = survey_ref.browse(cr, uid, context.get('active_id'), context=context) exist_user = current_sur.invited_user_ids if exist_user: @@ -134,8 +134,8 @@ class survey_send_invitation(osv.osv_memory): file_data += line if not line: break - attachments.append((id.title +".pdf",file_data)) file.close() + attachments[id.title +".pdf"] = file_data os.remove(addons.get_module_resource('survey', 'report') + id.title +".pdf") for partner in self.pool.get('res.partner').browse(cr, uid, partner_ids):