Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4896 Visualizzazioni

Hi,

Odoo partner form view has following address types;

Contact, Invoice, Delivery, Private and Other.

I want to create a custom form view. I want to use this type field widget radio.

How can i set default selected value Contact?

For example;



But it is not working.

P.S: I'm using Odoo V16 Community Edition.

Thanks

Avatar
Abbandona
Autore

For example;
<field name="type" required="1" widget="radio" default="contact"/>
But it is not working.

In the form view, you can use a radio box and set the default value for the address type field to "Contact" to set a default value.

Risposta migliore

Hi,

You can change your code like this,

Python :

radio = fields.Selection(
[('contact', 'Contact'), ('invoice', 'Invoice'), ('delivery', 'Delivery'),
('other', 'Other')], default='contact', tracking=True)

XML

<field name="radio" widget="radio"/>


Regards

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
4
dic 23
22321
5
lug 24
15682
1
giu 22
27205
9
mag 22
53459
0
lug 20
2998