Odoo Help


fields.many2one ('my.model', selection=_selection_function ) Retourn all 'my.model' records

samir Guesmi
on 6/13/14, 5:50 AM 962 views

Hi guys, 

I am  trying to filter the list of my many2one field


def _selection_function(self, cr, uid, context=None):

vals = []

<some condition >

record = id,name

return vals

fields.many2one('my.model', 'Field Name', selection=_selection_function )

But in the browser , still display all record of my model, 


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

2 follower(s)


Asked: 6/13/14, 5:50 AM
Seen: 962 times
Last updated: 8/31/17, 9:48 AM