Odoo Help


How insert value in many2many field using xmlrpc call

on 7/24/13, 2:32 AM 3,457 views


I want insert value in many2many through xmlrpc , i make call that read value from xml file i have pass value in xml file like <category_ids> [[6, False, [3, 8]]]</category_ids> but it not link with category_ids, any help????

martin mueller
On 9/23/13, 7:20 PM

You have mixed parentheses and brackets

## we just search for the ids of all categories
ids = sock.execute(dbname, uid, pwd, 'res.partner.category', 'search', [])
## or specific categories
ids = sock.execute(dbname, uid, pwd, 'res.partner.category', 'search', [('name', 'like', 'cate%')])

partner_data = {'name':'Provider2', 'category_id': [(6, 0, ids)]}
partner_id = sock.execute(dbname, uid, pwd, 'res.partner', 'create', partner_data)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/24/13, 2:32 AM
Seen: 3457 times
Last updated: 3/16/15, 8:10 AM