跳至內容
選單
此問題已被標幟
1 回覆
7728 瀏覽次數

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

頭像
捨棄
最佳答案

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)
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 24
1946
0
7月 24
2972
0
7月 22
60
1
7月 22
2854
2
12月 23
33425