This question has been flagged

I am trying to define a selection method. I have created a method that outputs the exact values I need.

    list = [(2, 'John Smith'), (3, 'Jill Smith')]

If I use the following return statement 

    return [(2, 'John Smith'), (3, 'John Smith')]

EVERYTHING WORKS!!!! A perfectly displayed selection field.

When I use 

    return list

I dont get any errors however I get no selection values in my drop down.

CODE BELOW

###############################################

                    WORKS

###############################################

@api.model

def _selection_method(self):

    some stuff

    return [(2, 'John Smith'), (3, 'John Smith')]

############################################

                     FAILS

############################################

@api.model

def _selection_method(self):

some stuff

     list = [(2, 'John Smith'), (3, 'John Smith')]

return list

#############################################

This is my selection field

selected_object = fields.Selection('_selection_method', string="Some String")


Avatar
Discard