İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4482 Görünümler

Hi everyone, im newbie in odoo and I have some concern related to many2one field.

In many2one field there's an option to create and edit. When I created an item it automatically appear as selected value in many2one field and I want to disable this feature. What I want to achieve is, after added new item many2one field value is empty but still the list of item is available.

Hope you could help me.

Thanks and advance. :-)

 

Avatar
Vazgeç
En İyi Yanıt

Set domain =-1

test_id = fields.Many2one('model.one',string="Test",required=True,domain="[('id','=',-1)]") 
Avatar
Vazgeç
Üretici

Hi Sehrish, I hope you understand my concern. I tried your solution but didn't work, still the newly added item show in many2one field as selected value. In many2one field if you want to create new item and save it, by default it will show automatically as selected value and this is what I want to disable. The item will be added in the selection only but don't set as selected. Thanks

Have you find your answer? @NRJ