Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
7237 Vues

How can i define a dynamic selection field where the user can add new items that are not predefined this code define a static selection field:

score:field.selection([('key1','value1').....],string='score'),

Avatar
Ignorer
Meilleure réponse

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Ignorer
Meilleure réponse

Hi, try this:

def _dinamic_selection(self):
    list_field = []
    # add elementos to list
    return list_field


_columns = {
    'field_selecction' : fields.selection('_dinamic_selection', 'Dinamic Field Selection'),
}


I hope you help, regards.

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
août 25
2536
3
févr. 25
3831
0
mai 24
46
1
avr. 24
3529
4
sept. 23
5071