Odoo Help


distinct_field_get in ORM

on 3/19/14, 3:18 AM 837 views

Does anybody knows about use of distinct_field_get in orm methods

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.


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)


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