Skip to Content
Menu
This question has been flagged
2 Replies
3761 Views

I try to create a partial delivery and a backlog via XMLRPC and Ruby.

Writing the partial delivery is ok

models.execute_kw(db, uid, password, 'stock.pack.operation', 'write', [oLID,{"qty_done": mqty}])

If i try to create the backlog(backorder) i'm unable to call the process method.

pick_ids = models.execute_kw(db, uid, password, 'stock.picking', 'search_read', [[['origin', '=', 'PO00025']]], )

pick_id = pick_ids[0]["id"]

id = models.execute_kw(db, uid, password, 'stock.backorder.confirmation', 'create', [{'pick_id': pick_id}])

result = models.execute_kw(db, uid, password, 'stock.backorder.confirmation', 'process', [id])


Error:

XMLRPC::FaultException: Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/odoo/service/wsgi_server.py", line 57, in xmlrpc_return

    response = xmlrpclib.dumps((result,), methodresponse=1, allow_none=False, encoding=None)

  File "/usr/lib64/python2.7/xmlrpclib.py", line 1086, in dumps

    data = m.dumps(params)

  File "/usr/lib64/python2.7/xmlrpclib.py", line 633, in dumps

    dump(v, write)

  File "/usr/lib64/python2.7/xmlrpclib.py", line 655, in __dump

    f(self, value, write)

  File "/usr/lib64/python2.7/xmlrpclib.py", line 659, in dump_nil

    raise TypeError, "cannot marshal None unless allow_none is enabled"

TypeError: cannot marshal None unless allow_none is enabled

        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/xmlrpc-0.3.0/lib/xmlrpc/client.rb:272:in `call'

        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/xmlrpc-0.3.0/lib/xmlrpc/client.rb:622:in `method_missing'

        from (irb):164

        from C:/Ruby24-x64/bin/irb.cmd:19:in `<main>'


Can someone tell me how I can implement the function?


Avatar
Discard
Best Answer

hi, were you able to solve this problem? :)

Avatar
Discard
Best Answer

Hy,

when used via XMLRPC, your method MUST return something.

return True should be enough.

regards

Avatar
Discard