Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2202 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Nov 19
8022
1
Jan 25
1374
1
Mar 24
2807
0
Jul 22
2457
3
Sep 20
3105