تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4189 أدوات العرض

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
مايو 22
10680
2
يوليو 23
2976
2
نوفمبر 21
13560
1
يوليو 18
7040
1
يناير 18
5080