跳至内容
菜单
此问题已终结
1 回复
3601 查看

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]]]  


形象
丢弃
相关帖文 回复 查看 活动
3
7月 25
698
1
8月 23
13137
2
11月 22
6194
1
6月 22
8209
1
9月 21
3136