Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3617 Weergaven

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

Avatar
Annuleer
Auteur Beste antwoord

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


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
jul. 25
706
1
aug. 23
13138
2
nov. 22
6197
1
jun. 22
8212
1
sep. 21
3139