Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7363 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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


slug = fields.Char(size=50)
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
maj 21
19590
1
maj 23
2899
3
mar 20
43934
0
mar 15
4913
1
lut 23
8632