parameters: (self, url, params=False)
return_statement: return response['result']
docstring: Make a request to proxy and handle the generic elements of the reponse (errors, new refresh token).
docstring_summary: Make a request to proxy and handle the generic elements of the reponse (errors, new refresh token).
docstring_tokens: Make a request to proxy and handle the generic elements of the reponse ( errors new refresh token ) .
function: def _make_request(self, url, params=False):
          ''' Make a request to proxy and handle the generic elements of the reponse (errors, new refresh token).
          '''
          payload = {
              'jsonrpc': '2.0',
              'method': 'call',
              'params': params or {},
              'id': uuid.uuid4().hex,
          }
  
          if self.env['ir.config_parameter'].get_param('account_edi_proxy_client.demo', False):
              # Last barrier : in case the demo mode is not handled by the caller, we block access.
              raise Exception("Can't access the proxy in demo mode")
  
          try:
              response = requests.post(
                  url,
                  json=payload,
                  timeout=TIMEOUT,
                  headers={'content-type': 'application/json'},
                  auth=OdooEdiProxyAuth(user=self)).json()
          except (ValueError, requests.exceptions.ConnectionError, requests.exceptions.MissingSchema, requests.exceptions.Timeout, requests.exceptions.HTTPError):
              raise AccountEdiProxyError('connection_error',
                  _('The url that this service requested returned an error. The url it tried to contact was %s', url))
  
          if 'error' in response:
              message = _('The url that this service requested returned an error. The url it tried to contact was %s. %s', url, response['error']['message'])
              if response['error']['code'] == 404:
                  message = _('The url that this service tried to contact does not exist. The url was %r', url)
              raise AccountEdiProxyError('connection_error', message)
  
          proxy_error = response['result'].pop('proxy_error', False)
          if proxy_error:
              error_code = proxy_error['code']
              if error_code == 'refresh_token_expired':
                  self._renew_token()
                  return self._make_request(url, params)
              if error_code == 'no_such_user':
                  # This error is also raised if the user didn't exchange data and someone else claimed the edi_identificaiton.
                  self.active = False
              raise AccountEdiProxyError(error_code, proxy_error['message'] or False)
  
          return response['result']
function_tokens: def _make_request ( self , url , params = False ) : payload = { 'jsonrpc' : '2.0' , 'method' : 'call' , 'params' : params or { } , 'id' : uuid . uuid4 ( ) . hex , } if self . env [ 'ir.config_parameter' ] . get_param ( 'account_edi_proxy_client.demo' , False ) : # Last barrier : in case the demo mode is not handled by the caller, we block access. raise Exception ( "Can't access the proxy in demo mode" ) try : response = requests . post ( url , json = payload , timeout = TIMEOUT , headers = { 'content-type' : 'application/json' } , auth = OdooEdiProxyAuth ( user = self ) ) . json ( ) except ( ValueError , requests . exceptions . ConnectionError , requests . exceptions . MissingSchema , requests . exceptions . Timeout , requests . exceptions . HTTPError ) : raise AccountEdiProxyError ( 'connection_error' , _ ( 'The url that this service requested returned an error. The url it tried to contact was %s' , url ) ) if 'error' in response : message = _ ( 'The url that this service requested returned an error. The url it tried to contact was %s. %s' , url , response [ 'error' ] [ 'message' ] ) if response [ 'error' ] [ 'code' ] == 404 : message = _ ( 'The url that this service tried to contact does not exist. The url was %r' , url ) raise AccountEdiProxyError ( 'connection_error' , message ) proxy_error = response [ 'result' ] . pop ( 'proxy_error' , False ) if proxy_error : error_code = proxy_error [ 'code' ] if error_code == 'refresh_token_expired' : self . _renew_token ( ) return self . _make_request ( url , params ) if error_code == 'no_such_user' : # This error is also raised if the user didn't exchange data and someone else claimed the edi_identificaiton. self . active = False raise AccountEdiProxyError ( error_code , proxy_error [ 'message' ] or False ) return response [ 'result' ]