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

I'm trying to add attendees to an event with XML-RPC. 
I have this python code:

common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
uid = common.authenticate(db, username, password, {})
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
models.execute_kw(db, uid, password, 'calendar.event', 'write', [[85], {'partner_ids': [82]}])  

Event ID as well as partner ID are 100% correct.
But after I execute this the partner_ids field is still empty array and no  attendees were added to an event. Why is that?

How do I do this with XML-RPC?

This is the same in Odoo8 and Odoo12

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Ok, figured it out.

partner_ids is many2many field and in order to write to it to use this weird Odoo syntax like this:  'partner_ids': [[6, 0, [82]]]  


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 25
745
1
ส.ค. 23
13176
2
พ.ย. 22
6218
1
มิ.ย. 22
8226
1
ก.ย. 21
3159