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

Hi,

I would like to update a contact record with several tags (category_id).

This is my code :

id = 5404
TESLIST = [23, 30, 26]
contact_odoo_existing = MODELS.execute_kw(DB, UID, PASSWORD, 'res.partner', 'write', [[id], {
'category_id': [(6, 0, [TESLIST])]
}])

And this is the error i've got :

in write\n    new_links.update(pairs(act[2]))\nTypeError: unhashable type: \'list\'\n'>


Could you help me ?


頭像
捨棄

Thanks a lot it works fin now !

最佳答案

You should pass list of IDs for the category_id field but you are passing list of list of IDs which is causing the error.

It should be as follow:

'category_id': [(6, 0, TESLIST)] 


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
5月 22
10411
2
7月 23
2765
2
11月 21
13305
1
7月 18
6810
1
1月 18
4916