Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2135 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 19
7957
1
ม.ค. 25
1268
1
มี.ค. 24
2735
0
ก.ค. 22
2372
3
ก.ย. 20
3046