Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
20206 มุมมอง

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
2267
3
พ.ย. 24
6035
0
มี.ค. 24
1164
2
ก.พ. 23
255
0
ก.ค. 20
4151