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

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!!

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

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


slug = fields.Char(size=50)
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 21
18726
1
thg 5 23
2298
Time field in odoo Đã xử lý
3
thg 3 20
42663
0
thg 3 15
4111
1
thg 2 23
7812