[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
This commit is contained in:
committed by
Alexandre Kühn
parent
6afb7074e4
commit
16dd3da7a9
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user