Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4306 Zobrazení

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
Zrušit

Thanks a lot it works fin now !

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
kvě 22
10905
2
čvc 23
3190
2
lis 21
13721
1
čvc 18
7203
1
led 18
5205