Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Follow all records of new notification models in OpenERP(Odoo)?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 510
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: