@@ -256,6 +256,7 @@ private int authenticate_json_rpc() throws Throwable {
256
256
methodparams .add (databaseName );
257
257
methodparams .add (userName );
258
258
methodparams .add (password );
259
+ //TODO : maybe also use the same syntax as reporting
259
260
jsonparams .put ("args" , methodparams );
260
261
261
262
int result = jsonclient .invoke ("call" , jsonparams , int .class );
@@ -280,12 +281,20 @@ public Object[] call_report_jsonrpc(String reportModel, String reportMethod, Arr
280
281
methodparams .add (password );
281
282
methodparams .add (reportModel );
282
283
methodparams .add (reportMethod );
283
- methodparams .add (args );
284
284
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 );
285
291
jsonparams .put ("args" , methodparams );
286
-
287
292
Object [] result = jsonclient .invoke ("call" , jsonparams , Object [].class );
288
293
294
+ // methodparams.add(args);
295
+ // jsonparams.put("args", methodparams);
296
+ // Object[] result = jsonclient.invoke("call", jsonparams, Object[].class);
297
+
289
298
return result ;
290
299
291
300
}
0 commit comments