Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
20220 Переглядів

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?


Аватар
Відмінити
Найкраща відповідь

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')
Аватар
Відмінити
Автор

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

Автор Найкраща відповідь

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

Аватар
Відмінити
Найкраща відповідь

Try in XML view this:


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лист. 23
2270
3
лист. 24
6042
0
бер. 24
1166
2
лют. 23
255
0
лип. 20
4153