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))]
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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).
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jul 25
|
1542 | ||
|
0
Mar 25
|
878 | ||
|
1
Jul 24
|
1605 | ||
|
7
Jul 24
|
24169 | ||
|
2
Apr 24
|
2997 |