summaryrefslogtreecommitdiff
path: root/addons/mail/mail_message.py
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@openerp.com>2012-08-15 20:57:13 +0200
committerFabien Pinckaers <fp@openerp.com>2012-08-15 20:57:13 +0200
commitd820e866ee2ce0a69a268c0302cbbeb45e5b0f50 (patch)
treec3e88ba65e7990d5306c87c49c23431100bb4310 /addons/mail/mail_message.py
parenta4f9b6ca0971aa5aca6fa30342e6acb950f42c3b (diff)
parent50275e9ec945ba6865a09e9cd708793018bed0dd (diff)
[MERGE] trunk
bzr revid: fp@openerp.com-20120815185713-82zylb0yqqgs008y
Diffstat (limited to 'addons/mail/mail_message.py')
-rw-r--r--addons/mail/mail_message.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index 1262cbb9fc7..5994f971deb 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -70,6 +70,9 @@ class mail_message(osv.Model):
return result
def name_get(self, cr, uid, ids, context=None):
+ # name_get may receive int id instead of an id list
+ if isinstance(ids, (int, long)):
+ ids = [ids]
res = []
for message in self.browse(cr, uid, ids, context=context):
name = ''
@@ -96,11 +99,10 @@ class mail_message(osv.Model):
# this is redundant with notifications ? Yes
'partner_ids': fields.many2many('res.partner',
- 'mail_message_destination_partner_rel',
+ 'mail_message_res_partner_rel',
'message_id', 'partner_id', 'Destination partners',
help="When sending emails through the social network composition wizard"\
"you may choose to send a copy of the mail to partners."),
-
'attachment_ids': fields.one2many('ir.attachment', 'res_id', 'Attachments'
domain=[('res_model','=','mail.message')]),
@@ -204,7 +206,6 @@ class mail_message(osv.Model):
self.check(cr, uid, ids, 'unlink', context=context)
return super(mail_message, self).unlink(cr, uid, ids, context)
- # FP Note: to be simplified, mail.message fields only, not mail.mail
def parse_message(self, message, save_original=False, context=None):
"""Parses a string or email.message.Message representing an
RFC-2822 email, and returns a generic dict holding the