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 add an attribute to main "widget" used in qweb?

Shawn Varghese
on 1/15/15, 12:17 AM 916 views

I am trying to customize some QWeb reports and have seen the use of "widget" in multiple places.

e.g. In /web/static/src/xml/base.xml, the following are used:

<t t-foreach="widget.sections" t-as="section">



I understand that these attributes have probably been defined in the JS files. But how do I add a new variable which can be used as a property of widget? I tried assigning "this.new_var=new_var", in JS, but I was unable to access it in qweb. Also, is there any way of displaying all the properties of widget (similar to console.log(self) in JS) ?



One way to obtain the list of widgets is through:

Shawn Varghese
on 1/15/15, 8:57 AM
Shawn Varghese
On 1/15/15, 8:57 AM

Ok, one way to obtain the list is through:

<t t-log="widget" />

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: 1/15/15, 12:17 AM
Seen: 916 times
Last updated: 3/16/15, 8:10 AM