To add followers linked to new partner fields first we have to go in .py file (Python file) After that we have to decide where we want followers linked to new partner fields and then write start to end python code in .py file:
for field in fields:
direct_field = field.split('.')[0]
field_to_recompute = direct_field in self.pool.pure_function_fields
if not field_to_recompute:
for expr in self._fields[direct_field].depends:
if expr.split('.')[0] in vals:
field_to_recompute = True
if direct_field in vals or field_to_recompute:
if hasattr(res, 'ids'):
ids = res.ids
if res and isinstance(res, (long, int)) and res is not True:
ids = [res]
_filter = lambda partner: self._name in [m.model for m in partner.notification&_model_ids]
for record in self.pool[self._name].browse(cr, SUPERUSER_ID, ids, context):
contacts = record.mapped(field)._get_contacts_to_notify().filtered(_filter)
record.message_subscribe(contacts.ids)
return res
0 Comment(s)