[FIX] mail: mail_create_nosubscribe context key also supported in message_post: allows to avoid subscribing the author to the document.

bzr revid: tde@openerp.com-20130320084011-coyf9p1il2ue04bb
This commit is contained in:
Thibault Delavallée
2013-03-20 09:40:11 +01:00
parent 31efad4ecd
commit 82b3e9b5fd
+1 -1
View File
@@ -1029,7 +1029,7 @@ class mail_thread(osv.AbstractModel):
# Create and auto subscribe the author
msg_id = mail_message.create(cr, uid, values, context=context)
message = mail_message.browse(cr, uid, msg_id, context=context)
if message.author_id and thread_id and type != 'notification':
if message.author_id and thread_id and type != 'notification' and not context.get('mail_create_nosubscribe'):
self.message_subscribe(cr, uid, [thread_id], [message.author_id.id], context=context)
return msg_id