Odoo Help

1 Answer

Akhil P Sivan

--Akhil P Sivan--

| 5 4 7
Kochi, India
--Akhil P Sivan--

Odoo Developer

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
05-10-15 07:42


Please try the "_sel_function" like this to return list containing distinct values:

def _sel_func(self, cr, uid,context=None):
cr.execute("select distinct on(caller) id,caller FROM calldata1 order by caller")
result = cr.fetchall()
lst = []
new_lst = []
for r in result:
dct = {}
dct['id'] = r[o]
dct['name'] = r[1]
new_lst = {v['id']:v for v in lst}.values()
res_ids = [(r['id'], r['name']) for r in new_lst]
return res_ids

But you can use a functional field with type "many2one", right? Please tell me the details of what you exactly need to do?

Stel een vraag
Keep Informed
0 volger(s)
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