Does anybody knows about use of distinct_field_get in orm methods
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
1
Reply
5644
Views
In odoo 8, I use it as follows:
def getUniqueFieldValues(self):
ModelABC = http.request.env['module_name.modelabc']
unique_values = ModelABC.distinct_field_get(field='field_name', value='')
return sorted(set(unique_values))
The python sorted(set()) function will sort and remove duplicates
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
Sep 23
|
6393 | ||
|
2
Mar 23
|
44268 | ||
|
2
Dec 23
|
54318 | ||
|
0
Mar 22
|
1026 | ||
|
3
Jun 20
|
9172 |