Odoo Help

0

distinct_field_get in ORM

By
mid123
on 3/19/14, 3:18 AM 930 views

Does anybody knows about use of distinct_field_get in orm methods

0
Habib
On 5/19/15, 8:41 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 3/19/14, 3:18 AM
Seen: 930 times
Last updated: 6/23/15, 8:42 PM