Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
6745 Vues

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
Ignorer
Meilleure réponse

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


slug = fields.Char(size=50)
Avatar
Ignorer
Publications associées Réponses Vues Activité
2
mai 21
18716
1
mai 23
2282
3
mars 20
42607
0
mars 15
4080
1
févr. 23
7776