Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2120 Vues

I have a many2one relationship that feeds a dropdown menu


I have a filter on the relationship, like this


domain=[('some_field', '=', True)]


this selects the records that appear in the dropdown menu

But if I want to create a new record from the dropdown menu, I'd also like the field "some_field" to be automatically set to True

How can I achieve that ?

I tried

context={'some_field': True}

but it seems it didn't work


Thanks

Avatar
Ignorer
Meilleure réponse

Hi,

You have to do it is as follows: context={'default_some_field': True}

Passing default value in context: https://www.youtube.com/watch?v=b4SeEVm39pY


Thanks

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
nov. 19
7952
1
janv. 25
1253
1
mars 24
2712
0
juil. 22
2359
3
sept. 20
3027