跳至内容
菜单
此问题已终结
2 回复
3889 查看

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
10227
2
7月 23
2603
2
11月 21
13148
1
7月 18
6693
1
1月 18
4793