İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
4190 Görünümler

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
Vazgeç

Thanks a lot it works fin now !

En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
May 22
10680
2
Tem 23
2976
2
Kas 21
13561
1
Tem 18
7041
1
Oca 18
5081