Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
20253 Lượt xem

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?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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')
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Try in XML view this:


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 23
2286
3
thg 11 24
6075
0
thg 3 24
1171
2
thg 2 23
255
0
thg 7 20
4174