Skip to Content
मेन्यू
This question has been flagged
3965 Views

I am trying to get selections for multiple fields from the same method, but I don't find the way to pass the values:

_columns = { 
    'x_standard': fields.selection(selection='_get_selection', string='Standards', required=1),
    'x_pressure': fields.selection(selection='_get_selection', string='Pressure', required=1),
}
def _get_selection(fieldname):
    selection = []
    if fieldname=='x_stanadard':
        selection=[('xxx','xxx')]
    elif fieldname=='x_pressure':
        selection=[('yyy','yyy')]
    return selection

Thanks for any help!

Avatar
Discard
Related Posts Replies Views Activity
2
दिस॰ 17
16937
1
मार्च 15
9514
1
दिस॰ 24
1584
0
जून 19
3802
1
अग॰ 18
8068