Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4283 Tampilan

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
Buang
Post Terkait Replies Tampilan Aktivitas
3
Sep 25
17414
1
Mar 15
9801
1
Des 24
1865
0
Jun 19
4058
1
Agu 18
8394