Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3817 Visualizzazioni

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
dic 17
16700
1
mar 15
9374
1
dic 24
1401
0
giu 19
3689
1
ago 18
7932