Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
7446 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

This worked perfectly, Thanks a lot :-)

Publicaciones relacionadas Respuestas Vistas Actividad
3
jul 25
3014
1
nov 24
18899
1
oct 24
2193
1
abr 24
2252
0
sept 23
1750