Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3887 มุมมอง

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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 22
10226
2
ก.ค. 23
2601
2
พ.ย. 21
13148
1
ก.ค. 18
6693
1
ม.ค. 18
4791