Skip to Content
Menú
This question has been flagged
1 Respondre
6981 Vistes

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

Avatar
Descartar
Best Answer

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


slug = fields.Char(size=50)
Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de maig 21
19031
1
de maig 23
2479
3
de març 20
43115
0
de març 15
4415
1
de febr. 23
8091