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

I'm trying to use HTML attributes with form fields. What I was trying is to use maxlength attribute with a text field. I tried the followings:


1. <field name="slug" maxlength="50" />
2. <field name="slug" attrs="{'maxlength': '50'}" />


But neither of these tactics are not working. Is it possible to use native HTML attributes like maxlength, size etc with Odoo form fields?

Any help would be appreciable!!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Fields of type text have a size parameters that can be used in definiton


slug = fields.Char(size=50)
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 21
18861
1
พ.ค. 23
2358
Time field in odoo แก้ไขแล้ว
3
มี.ค. 20
42854
0
มี.ค. 15
4206
Inheriting attributes from Fields แก้ไขแล้ว
1
ก.พ. 23
7944