(self, act_type_xmlids='', user_id=None, additional_domain=None)
return self.env['mail.activity'].search(domain)
Search automated activities on current record set, given a list of activity
        types xml IDs. It is useful when dealing with specific types involved in automatic
        activities management.

        :param act_type_xmlids: list of activity types xml IDs
        :param user_id: if set, restrict to activities of that user_id;
        :param additional_domain: if set, filter on that domain;
Search automated activities on current record set, given a list of activity
        types xml IDs. It is useful when dealing with specific types involved in automatic
        activities management.
Search automated activities on current record set given a list of activity types xml IDs . It is useful when dealing with specific types involved in automatic activities management .
def activity_search(self, act_type_xmlids='', user_id=None, additional_domain=None):
        """ Search automated activities on current record set, given a list of activity
        types xml IDs. It is useful when dealing with specific types involved in automatic
        activities management.

        :param act_type_xmlids: list of activity types xml IDs
        :param user_id: if set, restrict to activities of that user_id;
        :param additional_domain: if set, filter on that domain;
        """
        if self.env.context.get('mail_activity_automation_skip'):
            return False

        Data = self.env['ir.model.data'].sudo()
        activity_types_ids = [type_id for type_id in (Data._xmlid_to_res_id(xmlid, raise_if_not_found=False) for xmlid in act_type_xmlids) if type_id]
        if not any(activity_types_ids):
            return False

        domain = [
            '&', '&', '&',
            ('res_model', '=', self._name),
            ('res_id', 'in', self.ids),
            ('automated', '=', True),
            ('activity_type_id', 'in', activity_types_ids)
        ]

        if user_id:
            domain = expression.AND([domain, [('user_id', '=', user_id)]])
        if additional_domain:
            domain = expression.AND([domain, additional_domain])

        return self.env['mail.activity'].search(domain)
def activity_search ( self , act_type_xmlids = '' , user_id = None , additional_domain = None ) : if self . env . context . get ( 'mail_activity_automation_skip' ) : return False Data = self . env [ 'ir.model.data' ] . sudo ( ) activity_types_ids = [ type_id for type_id in ( Data . _xmlid_to_res_id ( xmlid , raise_if_not_found = False ) for xmlid in act_type_xmlids ) if type_id ] if not any ( activity_types_ids ) : return False domain = [ '&' , '&' , '&' , ( 'res_model' , '=' , self . _name ) , ( 'res_id' , 'in' , self . ids ) , ( 'automated' , '=' , True ) , ( 'activity_type_id' , 'in' , activity_types_ids ) ] if user_id : domain = expression . AND ( [ domain , [ ( 'user_id' , '=' , user_id ) ] ] ) if additional_domain : domain = expression . AND ( [ domain , additional_domain ] ) return self . env [ 'mail.activity' ] . search ( domain )