This question has been flagged
1 Reply
10113 Views

Hi , I want a new method which will update the customer total receivables (guess by creating the corresponding account.move objects) which has to be called via xml-rpc . Is there anything more to be done than making this method public and using XML RPC to invoke this method in the right resource with the right params . When I tried to do it ,it gave an error saying parameters not matching (expected min 5 but got only 4) My definition is something like -

 def update_customer_receivables(self, cr, uid, partner_id,amount,context=None):

And my java client looks something like this :

   Object args1[]={"partner_id","=",patientId};
    Object args2[]={"amount","=",amount};
    Vector params = new Vector();
    params.addElement(args1);
    params.addElement(args2);

And the call :

        Object args[]={database,id,password,resource,"update_customer_receivables",params};
          xmlRpcClient().execute("execute", args)

What am I missing ? Any help is appreciated

Avatar
Discard
Best Answer

The procedure to let openERP know additional info:

  1. copy the module to the /addon directory
  2. restart openERP (or even the machine)
  3. update the module list (not always needed)
  4. install or upgrade the modified module

I think that you need to do 4 (and maybe 3 as well) in order for openERP to know the added (or changed) method.

Avatar
Discard
Author

Thanks .Guess in my case I also made a silly mistake .In the client I had been passing all the values as a single list .So I changed my method to something like " def update_customer_receivables(self, cr, uid, args,context=None):" where args is a 2 dimensional List .This fixed it

If it is fixed, can you close this question?