Skip to Content
Menu
This question has been flagged
1 Atsakyti
7445 Rodiniai

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)

Portretas
Atmesti
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})


Portretas
Atmesti
Autorius

This worked perfectly, Thanks a lot :-)

Related Posts Replies Rodiniai Veikla
3
liep. 25
3013
1
lapkr. 24
18897
1
spal. 24
2193
1
bal. 24
2252
0
rugs. 23
1750