Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6919 Visualizzazioni

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
Abbandona
Risposta migliore

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


slug = fields.Char(size=50)
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 21
18924
1
mag 23
2411
3
mar 20
42934
0
mar 15
4259
1
feb 23
7999