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.


Is there any widget options documentation?

Jeff Beidler
on 10/28/14, 7:08 PM 2,498 views

Looking at various template XML files, I sometimes see something like this:

t-field-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'

However, I can't find any detailed documentation for various options that are available for such a statement.  There's lots of stuff on "widgets", but it's all about writing Python code to create your own thingamajig.  Is there any documentation for the XML formatting widgets?

@Jeff, I'm also interested in this. I've purchased the theme developer handbook from Odoo's indiegogo campaign here: https://www.indiegogo.com/projects/bootstrap-themes-for-odoo-cms although the book is not likely to be released until the campaign finishes I believe it does cover the subject as it applies to the CMS/E-commerce and theme modules. Once I have read the book I will write back here with information on what I have learnt, however in the meantime if you find any resources covering widget creation and customisation I would be interested to know what you have found.

Luke Branch
on 10/28/14, 9:22 PM
On 8/3/15, 6:22 PM

There's some basic Widgets documentation here: https://www.odoo.com/documentation/8.0/howtos/web.html#widgets-basics but that doesn't really cover the 'options' for widgets.

 One tip that I found that I'll leave here in case someone else comes looking (as I did): you can pass 'options' to the widget from the XML <field/> definition by setting an 'options' attribute to a JSON dictionary, like this:

<field name="myfield" widget='many2many_checkboxes' options='{"horizontal": 1}' />

This will set widget.options.horizontal to 1, and this option is then available within the QWeb template for the widget, so you can use options to alter the templated layout, for example.

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

2 follower(s)


Asked: 10/28/14, 7:08 PM
Seen: 2498 times
Last updated: 8/3/15, 6:22 PM