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

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?


Awatar
Odrzuć
Najlepsza odpowiedź

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')
Awatar
Odrzuć
Autor

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

Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

Try in XML view this:


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lis 23
2284
3
lis 24
6068
0
mar 24
1170
2
lut 23
255
0
lip 20
4171