original_docstring:  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
  
              models that have an access_token may apply variations on this.
          
docstring: 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
  
  models that have an access_token may apply variations on this.
docstring_tokens: 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 models that have an access_token may apply variations on this .
code: def mail_action_view(self, model=None, res_id=None, access_token=None, **kwargs):
          """ 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
  
              models that have an access_token may apply variations on this.
          """
          # ==============================================================================================
          # This block of code disappeared on saas-11.3 to be reintroduced by TBE.
          # This is needed because after a migration from an older version to saas-11.3, the link
          # received by mail with a message_id no longer work.
          # So this block of code is needed to guarantee the backward compatibility of those links.
          if kwargs.get('message_id'):
              try:
                  message = request.env['mail.message'].sudo().browse(int(kwargs['message_id'])).exists()
              except:
                  message = request.env['mail.message']
              if message:
                  model, res_id = message.model, message.res_id
          # ==============================================================================================
  
          if res_id and isinstance(res_id, pycompat.string_types):
              res_id = int(res_id)
          return self._redirect_to_record(model, res_id, access_token, **kwargs)
code_tokens: def mail_action_view ( self , model = None , res_id = None , access_token = None , ** kwargs ) : if kwargs . get ( 'message_id' ) : try : message = request . env [ 'mail.message' ] . sudo ( ) . browse ( int ( kwargs [ 'message_id' ] ) ) . exists ( ) except : message = request . env [ 'mail.message' ] if message : model , res_id = message . model , message . res_id if res_id and isinstance ( res_id , pycompat . string_types ) : res_id = int ( res_id ) return self . _redirect_to_record ( model , res_id , access_token , ** kwargs )
short_docstring: Generic access point from notification emails.
short_docstring_tokens: Generic access point from notification emails .
comment: """ 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
  
              models that have an access_token may apply variations on this.
          """$SEP$# ==============================================================================================$SEP$# This block of code disappeared on saas-11.3 to be reintroduced by TBE.$SEP$# This is needed because after a migration from an older version to saas-11.3, the link$SEP$# received by mail with a message_id no longer work.$SEP$# So this block of code is needed to guarantee the backward compatibility of those links.$SEP$# ==============================================================================================