Odoo Help


This community 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.


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

on 6/13/14, 5:50 AM 607 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, 

On 6/13/14, 7:18 AM

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 6/13/14, 5:50 AM
Seen: 607 times
Last updated: 3/16/15, 8:10 AM