'Generic access point from notification emails. The heuristic to
choose where to redirect the user is the following :
- find a public URL
- if none found
- users with a read access are redirected to the document
- users without read access are redirected to the Messaging
- not logged users are redirected to the login page'

@http.route('/mail/view', type='http', auth='none')
def mail_action_view(self, model=None, res_id=None, message_id=None):

    if message_id:
        try:
            message = request.env['mail.message'].sudo().browse(int(message_id)).exists()
        except:
            message = request.env['mail.message']
        if message:
            (model, res_id) = (message.model, message.res_id)
        else:
            return self._redirect_to_messaging()
    elif (res_id and isinstance(res_id, basestring)):
        res_id = int(res_id)
    return self._redirect_to_record(model, res_id)
