Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6855 Представления

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

Аватар
Отменить
Лучший ответ

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


slug = fields.Char(size=50)
Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
мая 21
18849
1
мая 23
2357
3
мар. 20
42851
0
мар. 15
4192
1
февр. 23
7931