跳至内容
菜单
此问题已终结
1 回复
11571 查看

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

形象
丢弃
最佳答案

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.

形象
丢弃
编写者

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?

相关帖文 回复 查看 活动
0
8月 22
2343
1
3月 15
17692
0
1月 25
838
1
5月 23
7469
1
10月 20
5527