selection parameter in many2one field doesn't work

Bug #569364 reported by Digitel

This bug report was converted into a question: question #108611: selection parameter in many2one field doesn't work.

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Version 5.0.9
When trying to use the selection parameter on a field, the result is not filtered at all.
In the example mentioned below, all extensions are present when having to chose the extension and not only the one returned by the _sel_extension function

class asterisk_user(osv.osv):

    def _sel_extension(self, cr, uid, context={}):
        obj = self.pool.get("asterisk.extensions")
        ids = obj.search(cr, uid, [('type','=','sip_extension')], context=context)
        res = obj.read(cr, uid, ids, ['name','id'], context=context)
        res = tuple([(r['id'],r['name']) for r in res])
        return res

    _name = "res.users"
    _inherit = "res.users"
    _columns = {
        "extension":fields.many2one('asterisk.configuration.file.category','extension',selection=_sel_extension),
    }
asterisk_user()

Changed in openobject-server:
status: New → Invalid
milestone: none → 5.0.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.