Impacted versions:

8.0

Steps to reproduce:

To reproduce this one, you have to configure outgoing and incoming server and mail aliases

see https://youtu.be/-HzDGh9C9Jc

Current behavior:

If you add a user which has no acces on a object (purchase.order in this case) as follower on a record of this object **AFTER someone has responded by email on this record**, and if you send an message on this record, an exception is raised at the connection of the user added as a follower.

Expected behavior:

No exceptions should be raised at the connection of the user added as a follower.

Video/Screenshot link (optional):

https://youtu.be/-HzDGh9C9Jc

addons/mail/mail_message.py
model_access_obj = self.pool.get('ir.model.access')
        allowed_ids = set()
        for doc_model, doc_dict in model_ids.iteritems():
            if not model_access_obj.check(cr, uid, doc_model, 'read', False):
                continue
            allowed_ids |= self._find_allowed_model_wise(cr, uid, doc_model, doc_dict, context=context)
        return allowed_ids
    def _search(self, cr, uid, args, offset=0, limit=None, order=None,
                context=None, count=False, access_rights_uid=None):
        """ Override that adds specific access rights of mail.message, to remove
            ids uid could not see according to our custom rules. Please refer
            to check_access_rule for more details about those rules.
            After having received ids of a classic search, keep only:
            - if author_id == pid, uid is the author, OR
            - a notification (id, pid) exists, uid has been notified, OR
            - uid have read access to the related document is model, res_id
            - otherwise: remove the id
        """
        
        if uid == SUPERUSER_ID:
            return super(mail_message, self)._search(
                cr, uid, args, offset=offset, limit=limit, order=order,
                context=context, count=count, access_rights_uid=access_rights_uid)
        
        ids = super(mail_message, self)._search(
            cr, uid, args, offset=offset, limit=limit, order=order,