تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7061 أدوات العرض

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

widget.items[1].length

widget.options

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:

الكاتب أفضل إجابة

Ok, one way to obtain the list is through:

<t t-log="widget" />

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
ديسمبر 16
17111
1
أبريل 25
1096
2
مارس 25
1255
4
نوفمبر 24
7009
1
مارس 24
1927