Skip to Content
Menu
This question has been flagged
2 Replies
3362 Views

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 ?


Avatar
Discard

Thanks a lot it works fin now !

Best Answer

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


Avatar
Discard
Related Posts Replies Views Activity
2
May 22
9410
2
Jul 23
1858
2
Nov 21
12683
1
Jul 18
6062
1
Jan 18
4244