The error message you should be seeing is as follows:
AttributeError: 'JsonRequest' object does not have a 'render' attribute
When dealing with JSON-RPC 2
, the request handler method returns the result as a JSON-RPC object and wraps it in a JSON-RPC Response.
The 'render' attribute is only accessible when using HttpRequest
.
You are making the correct call using jsonRpc
, so the problem likely lies within the request handler itself.
A similar example can be found in the website_gengo where the controller method is declared like this:
@http.route('/website/post_gengo_jobs', type='json', auth='user', website=True)
def post_gengo_jobs(self):
request.env['base.gengo.translations']._sync_request(limit=GENGO_DEFAULT_LIMIT)
return True
And then called using the following code:
ajax.jsonRpc('/website/post_gengo_jobs', 'call', {});