what result this expression domain="[('id', 'in', many2many-field[0][2])] will return and what is [0][2] ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Actually many2many will return a dictionary with three values as below.
[(0, False, [list of ids])]
So we have to specify [0][2] to get the ids of items.
eg:
suppose sale_products is a M2m field. with values P1, P2,P3
When we print it, It will return [(0, False, [id of p1,id of p2,id of p3])]
so we use [0][2] to get id of p1,id of p2,id of p3 from that field.
Hope it may help you :)
why we use M2m[0][2] and not M2m[2] plz can you explain more
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up