Odoo Help

Welcome!

This community 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.

1

How insert value in many2many field using xmlrpc call

By
jagdish
on 7/24/13, 2:32 AM 2,544 views

Hi

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

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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