Skip to Content
Menu
This question has been flagged
1 Atsakyti
6756 Rodiniai

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

Portretas
Atmesti
Best Answer

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


slug = fields.Char(size=50)
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
geg. 21
18721
1
geg. 23
2290
3
kov. 20
42637
0
kov. 15
4090
1
vas. 23
7799