From 16dd3da7a95bdbef925c1521455a55bfe2fd4357 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Tue, 5 Nov 2019 06:50:11 +0000 Subject: [PATCH] [IMP] mail: auto follow subtypes based parent record at creation With this commit, when the user subscribes to internal subtypes (i.e. activities and notes) on a parent record (e.g. project of tasks), then the user follows them by default on every record creation (e.g. all new tasks of this project). Task-Id 1974055 Closes #34150 --- addons/mail/models/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 6ca54653d87..bea8b37b867 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -2862,7 +2862,7 @@ class MailThread(models.AbstractModel): res = self.env['mail.followers']._get_subscription_data(doc_data, None, None, include_pshare=True) for fid, rid, pid, cid, subtype_ids, pshare in res: sids = [parent[sid] for sid in subtype_ids if parent.get(sid)] - sids += [sid for sid in subtype_ids if sid not in parent and sid in def_ids] + sids += [sid for sid in subtype_ids if sid not in parent and sid in def_ids or sid in int_ids] if pid: new_partners[pid] = (set(sids) & set(all_ids)) - set(int_ids) if pshare else set(sids) & set(all_ids) if cid: