Odoo Help

1

1
1 Answer
0
Avatar

Akhil P Sivan

--Akhil P Sivan--

4449
| 6 4 9
Kochi, Índia
--Akhil P Sivan--

Odoo Developer

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
05/10/15 07:42

Hi,

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]
lst.append(dct)
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?

Ask a Question
Writer
Keep Informed
0 follower(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.

Register
Odoo Training Center

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

Test it now