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

Hi. I'm trying to import slack channels into odoo but the above mentioned error arises. I am trying to populate a many2many field. I tried to pass tuple into it but got no luck. If anyone has any suggestions,do reply. While debugging, I realized that the error occurs when the ORM methods like write or create gets triggered.
Following is my line of code which I believe is the reason behind this error:

'channel_partner_ids': [(6, 0, tuple(total_partner_ids))]

Avatar
Discard
Best Answer

Hello Syed

In python, lists are unhashable types. Tuples are indeed hashable.

Please check the docs regarding "magic" field Commands. It's likely that the values you're using don't exist yet and so you need to CREATE them (magic value 0) and not SET them (magic value 6).

Avatar
Discard
Best Answer

Hi,

In Odoo, when you encounter the "unhashable type: 'list'" error in the context of a Many2many field, it could be due to how you are trying to create or update the Many2many field.The Many2many field expects a record set or a list of record IDs, and not a list of dictionaries directly.channel_partner_ids': [(6, 0, total_partner_ids.ids)]



Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
2
Jul 25
1542
0
Mar 25
878
1
Jul 24
1605
7
Jul 24
24169
2
Apr 24
2997