[FIX] fix problem in email.message.
bzr revid: ysa@tinyerp.com-20110208115104-olu3jr9uun6spjop
This commit is contained in:
@@ -238,7 +238,7 @@ class email_message(osv.osv):
|
||||
_("Error sending mail: %s") % e)
|
||||
|
||||
def email_send(cr, uid, email_from, email_to, subject, body, model=False, email_cc=None, email_bcc=None, reply_to=False, attach=None,
|
||||
openobject_id=False, debug=False, subtype='plain', x_headers=None, priority='3'):
|
||||
openobject_id=False, debug=False, subtype='plain', x_headers={}, priority='3'):
|
||||
attachment_obj = self.pool.get('ir.attachment')
|
||||
msg_vals = {
|
||||
'name': subject,
|
||||
@@ -253,7 +253,7 @@ class email_message(osv.osv):
|
||||
'reply_to': reply_to or '',
|
||||
'message_id': openobject_id,
|
||||
'sub_type': subtype or '',
|
||||
'headers': x_headers or '',
|
||||
'headers': x_headers or {},
|
||||
'priority': priority,
|
||||
'debug': debug,
|
||||
'folder': 'outbox',
|
||||
@@ -300,7 +300,7 @@ class email_message(osv.osv):
|
||||
smtp_account = account_obj.browse(cr, uid, smtp_ids, context)[0]
|
||||
tools.email_send(message.email_from, message.email_to, message.name, message.message, email_cc=message.email_cc,
|
||||
email_bcc=message.email_bcc, reply_to=message.reply_to, attach=attachments, openobject_id=message.message_id,
|
||||
subtype=message.sub_type, x_headers=message.headers, priority=message.priority, debug=message.debug,
|
||||
subtype=message.sub_type, x_headers=message.headers or {}, priority=message.priority, debug=message.debug,
|
||||
smtp_email_from=smtp_account and smtp_account.email_id or None, smtp_server=smtp_account and smtp_account.smtpserver or None,
|
||||
smtp_port=smtp_account and smtp_account.smtpport or None, ssl=smtp_account and smtp_account.smtpssl or False,
|
||||
smtp_user=smtp_account and smtp_account.smtpuname or None, smtp_password=smtp_account and smtp_account.smtppass or None)
|
||||
|
||||
Reference in New Issue
Block a user