Skip to Content
Menú
This question has been flagged
3 Respostes
19883 Vistes

Odoo 13

How to create URL link, in form view. For example odoo.com


model:

url_field = fields.Char('URL')

view:

<field name="url_field" widget="url" readonly="1" text="odoo.com"/>


Field is shown in form view, but value not exist ;(


How make it works?


Avatar
Descartar
Best Answer

You need to store the value in the URL field. The stored value will then be displayed on the screen. If you want to provide a default value for the URL, you can define the field like so in the model.

url_field = fields.Char('URL', default='https://www.odoo.com')
Avatar
Descartar
Autor

Thank You for answer. How will look field in view? I have still empty value in url_field

Autor Best Answer

Nevermind. It works. I needed to add "string=" as field attribute. Again, thank You for help Paresh

Avatar
Descartar
Best Answer

Try in XML view this:


Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de nov. 23
2062
3
de nov. 24
5773
0
de març 24
1008
2
de febr. 23
255
0
de jul. 20
4011