Skip to Content
Menu
This question has been flagged
3819 Zobrazenia

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
dec 17
16702
1
mar 15
9375
1
dec 24
1402
0
jún 19
3690
1
aug 18
7935