Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7444 มุมมอง

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)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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


อวตาร
ละทิ้ง
ผู้เขียน

This worked perfectly, Thanks a lot :-)

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 25
3013
1
พ.ย. 24
18897
1
ต.ค. 24
2193
1
เม.ย. 24
2252
0
ก.ย. 23
1750