Skip to Content
Menu
This question has been flagged
1 Reply
6651 Views

Im trying to confirm picking ( validate ) in odoo 10 using xmlrpc search works but not to call the model do_new_transfer

Maybe i cant do like this at all ? But how do I confirm picking ( validate ) via xmlrpc.

-- snippet ---

pick_id = models.execute_kw(db, uid, password,
    'stock.picking', 'search',
    [[['name', '=', 'WH/OUT/00002']]])

print pick_id

print models.execute_kw(
    db, uid, password, 'stock.picking', 'do_new_transfer', pick_id)

Avatar
Discard
Best Answer

Hello,

you need to pass parameters as a list.

Try this :

models.execute_kw(
    db, uid, password, 'stock.picking', 'do_new_transfer', [pick_id],{})

Calling methods

The second endpoint is xmlrpc/2/object, is used to call methods of odoo models via the execute_kw RPC function.

Each call to execute_kw takes the following parameters:

  • the database to use, a string
  • the user id (retrieved through authenticate), an integer
  • the user's password, a string
  • the model name, a string
  • the method name, a string
  • an array/list of parameters passed by position
  • a mapping/dict of parameters to pass by keyword (optional)

example :

models.execute_kw(db, uid, password,
    'res.partner', 'check_access_rights',
    ['read'], {'raise_exception': False})


Avatar
Discard
Author

This worked perfectly, Thanks a lot :-)

Related Posts Replies Views Activity
1
Nov 24
16356
1
Oct 24
267
1
Apr 24
510
2
Mar 24
736
0
Sep 23
575