OpenERP XML RPC 错误:“sale_order”对象没有属性“order_confirm”;

发布于 2024-12-02 20:47:11 字数 1711 浏览 2 评论 0原文

我正在尝试使用 java 通过 xml rpc 确认销售订单。

我的代码是

Log.i(MY_DEBUG_TAG, "XML RPC Confirming the sale order "+saleOrder.getId());
rpcResult = rpcClient.call("execute", DB_NAME, 1, PASSWORD, "sale.order", "order_confirm", saleOrder.getId()); 
Log.i(MY_DEBUG_TAG, "XML RPC RESULT = "+rpcResult.toString());

,当前的错误消息显示:

[2011-09-05 10:49:56,139][?] DEBUG_RPC:service:'object'
[2011-09-05 10:49:56,139][?] DEBUG_RPC:method:u'execute'
[2011-09-05 10:49:56,139][?] DEBUG_RPC:params:['itflux_demo', 1, '*', 'sale.order', 'order_confirm', 137]
[2011-09-05 10:49:56,140][itflux_demo] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
AttributeError: 'sale_order' object has no attribute 'order_confirm'
[2011-09-05 10:49:56,140][itflux_demo] DEBUG_RPC:exception:u"'sale_order' object has no attribute 'order_confirm'"
[2011-09-05 10:49:56,140][itflux_demo] DEBUG_RPC:xmlrpc:"POST /object HTTP/1.1" 200 -

并且记录的状态仍然是草稿

当我尝试通过 gtk 客户端确认相同的情况时,没有发现任何问题,并且相应的日志显示:

[2011-09-05 10:20:31,138][?] DEBUG_RPC:params:['itflux_demo', 1, '*', 'sale.order', 'order_confirm', 137]

并且记录的状态从 draft 更改为 manual

我的代码有什么问题吗?

I'm trying to confirm a sale order via xml rpc with java.

My code is

Log.i(MY_DEBUG_TAG, "XML RPC Confirming the sale order "+saleOrder.getId());
rpcResult = rpcClient.call("execute", DB_NAME, 1, PASSWORD, "sale.order", "order_confirm", saleOrder.getId()); 
Log.i(MY_DEBUG_TAG, "XML RPC RESULT = "+rpcResult.toString());

And the curreponding error message says:

[2011-09-05 10:49:56,139][?] DEBUG_RPC:service:'object'
[2011-09-05 10:49:56,139][?] DEBUG_RPC:method:u'execute'
[2011-09-05 10:49:56,139][?] DEBUG_RPC:params:['itflux_demo', 1, '*', 'sale.order', 'order_confirm', 137]
[2011-09-05 10:49:56,140][itflux_demo] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
AttributeError: 'sale_order' object has no attribute 'order_confirm'
[2011-09-05 10:49:56,140][itflux_demo] DEBUG_RPC:exception:u"'sale_order' object has no attribute 'order_confirm'"
[2011-09-05 10:49:56,140][itflux_demo] DEBUG_RPC:xmlrpc:"POST /object HTTP/1.1" 200 -

and the record's state is still draft.

When I tried to confirrm the same via gtk client, it found no issues and the corresponding log shows:

[2011-09-05 10:20:31,138][?] DEBUG_RPC:params:['itflux_demo', 1, '*', 'sale.order', 'order_confirm', 137]

and the record's state changed from draft to manual.

What is wrong with my code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上芳菲 2024-12-09 20:47:11

尝试使用这个 :

def exec_workflow(self, db, uid, passwd, object, method, id)

而不是 :

def execute(self, db, uid, passwd, object, method, *args)

所以,我猜会是:

rpcResult = rpcClient.call("exec_workflow", DB_NAME, 1, PASSWORD, "sale.order", "order_confirm", saleOrder.getId()); 

Try to use this :

def exec_workflow(self, db, uid, passwd, object, method, id)

instead of :

def execute(self, db, uid, passwd, object, method, *args)

So, it will be I guess :

rpcResult = rpcClient.call("exec_workflow", DB_NAME, 1, PASSWORD, "sale.order", "order_confirm", saleOrder.getId()); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文