@@ -256,6 +256,7 @@ private int authenticate_json_rpc() throws Throwable {
256256 methodparams .add (databaseName );
257257 methodparams .add (userName );
258258 methodparams .add (password );
259+ //TODO : maybe also use the same syntax as reporting
259260 jsonparams .put ("args" , methodparams );
260261
261262 int result = jsonclient .invoke ("call" , jsonparams , int .class );
@@ -280,12 +281,20 @@ public Object[] call_report_jsonrpc(String reportModel, String reportMethod, Arr
280281 methodparams .add (password );
281282 methodparams .add (reportModel );
282283 methodparams .add (reportMethod );
283- methodparams .add (args );
284284
285+ ArrayList <Object > empty_recordset_for_model_annotation_in_odoo = new ArrayList <>();
286+ //The render method is annotated @model in Odoo, so we must pass an empty value as the first
287+ //paramter otherwise Odoo will only interpret 1 parameter from the 2 given
288+ //TODO: find a way to identify if a metho is annotated with @api.model
289+ args .add (0 , empty_recordset_for_model_annotation_in_odoo );
290+ methodparams .add (args );
285291 jsonparams .put ("args" , methodparams );
286-
287292 Object [] result = jsonclient .invoke ("call" , jsonparams , Object [].class );
288293
294+ // methodparams.add(args);
295+ // jsonparams.put("args", methodparams);
296+ // Object[] result = jsonclient.invoke("call", jsonparams, Object[].class);
297+
289298 return result ;
290299
291300 }
0 commit comments