[FIX] mail: automatic subscription of responsible

Do not erase existing subscription with void subtypes.
This commit is contained in:
Thibault Delavallée
2016-02-08 12:16:58 +01:00
parent 05f44e597c
commit 82e60a9648
+2 -2
View File
@@ -1956,10 +1956,10 @@ class MailThread(models.AbstractModel):
for pid, subtypes in new_partners.items():
subtypes = list(subtypes) if subtypes is not None else None
self.message_subscribe(partner_ids=[pid], subtype_ids=subtypes)
self.message_subscribe(partner_ids=[pid], subtype_ids=subtypes, force=(subtypes != None))
for cid, subtypes in new_channels.items():
subtypes = list(subtypes) if subtypes is not None else None
self.message_subscribe(channel_ids=[cid], subtype_ids=subtypes)
self.message_subscribe(channel_ids=[cid], subtype_ids=subtypes, force=(subtypes != None))
# remove the current user from the needaction partner to avoid to notify the author of the message
user_pids = [user_pid for user_pid in user_pids if user_pid != self.env.user.partner_id.id]