Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to use Html attributes with Odoo form fields

Nikhil Mohan
on 7/28/16, 5:01 AM 246 views

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


Francesco OpenCode

--Francesco OpenCode--
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 7/28/16, 5:53 AM

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

slug = fields.Char(size=50)

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 7/28/16, 5:01 AM
Seen: 246 times
Last updated: 7/28/16, 5:53 AM