I am go to clear you how to convert one2many field records into radio button. For example you have a one2many field in some model and you want to show the records of one2many field as a radio button in some wizard. But we can not add radio button widget (widget="radio") in one2many field.
Show one2many field records as radio button in odoo wizard
We have some framework restriction here, the first is we can only add radio button widget (widget="radio") on selection field and the second one is we can not make a one2many relation directly in odoo wizard, so to get one2many field in wizard we will create a selection field and on button click or some event populate one2many records into selection field using context and display records as radio button by using radio button widget (widget="radio").
Python code - Model
XML Code - View
Don,t forgot to share, keep sharing keep learning
0 Comments