コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
20234 ビュー

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:


アバター
破棄
関連投稿 返信 ビュー 活動
1
11月 23
2277
3
11月 24
6045
0
3月 24
1168
2
2月 23
255
0
7月 20
4162