Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4481 Widoki

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. :-)

 

Awatar
Odrzuć
Najlepsza odpowiedź

Set domain =-1

test_id = fields.Many2one('model.one',string="Test",required=True,domain="[('id','=',-1)]") 
Awatar
Odrzuć
Autor

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