Closed JurassicPork closed 9 years ago
Found a solution in the file OpenERPCommand.java i have created a new function : public Boolean callObjectFunctionBoolean(String objectName, String functionName, Object[] parameters) throws XmlRpcException { return (Boolean) session.executeCommand(objectName, functionName, parameters); }
i have now no exception with this code : System.out.println(MaCommande.callObjectFunctionBoolean("hr.employee","attendance_action_change",params).toString()); display True.
Hi @JurassicPork ,
great proposal. I add it in the wishlist. Purpose will be to ease the managemnt of non native Odoo method
hello, i try to execute the function attendance_action_change of hr.employee object (hr_attendance.py). with the following code seems to be ok but i have this exception : java.lang.Boolean cannot be cast to [Ljava.lang.Object; java.lang.ClassCastException: java.lang.Boolean cannot be cast to [Ljava.lang.Object; at com.debortoliwines.openerp.api.OpenERPCommand.callObjectFunction(OpenERPCommand.java:171)
the code : try { OpenERPCommand MaCommande = new OpenERPCommand(openERPSession); Object[] params = new Object[] {1}; MaCommande.callObjectFunction("hr.employee","attendance_action_change",params);
} catch (Exception e) { System.out.println("Error while reading data from server:\n\n" + e.getMessage() ); e.printStackTrace(); }
the end of the function attendance_action_change is "return true"
Another way to execute attendance_action_change ?