Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4844 Представления

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

Аватар
Отменить
Автор

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.

Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
4
дек. 23
22259
5
июл. 24
15626
1
июн. 22
27142
9
мая 22
53388
0
июл. 20
2947