In followers all records and new notification models, first we have to go in .py file (Python file) After that we have to decide where we want all records and new notification models of followers and then write below python code to that field at start to end.
Use below .py code in python file:
for model in self.notification_model_ids:
if model.model in self.env.registry.models:
model_obj = self.env[model.model]
domain = []
if not hasattr(model_obj, '_follow_partner_fields'):
continue
for field in model_obj._follow_partner_fields:
domain.append((field, 'in', parents.ids))
if domain:
records = model_obj.with_context(active_test=False).search(domain)
records.message_subscribe(partner_ids=[self.id])
0 Comment(s)