Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2180 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 19
7980
1
led 25
1339
1
bře 24
2782
0
čvc 22
2429
3
zář 20
3082