تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
20237 أدوات العرض

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
نوفمبر 23
2279
3
نوفمبر 24
6053
0
مارس 24
1170
2
فبراير 23
255
0
يوليو 20
4167