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

Guys

I want to show the objects like following without using python code.

<t t-foreach="code equivalent to request.env['your.model'].search([])"  t-as="obj">
       <t t-esc="obj.name"/>
 </t>

Is it possible?


الصورة الرمزية
إهمال

so you dont need to fetch from template .. do you mean that?

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

I solved. My question was answer. 

<t t-foreach="request.env['your.model'].search([])" t-as="obj">
    <t t-esc="obj.name"/>
</t>


الصورة الرمزية
إهمال

This is awesome!!! - Thanks!

أفضل إجابة

For qweb templates, it doesn't work.
it's basically for odoo website template, not for qweb template.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مايو 22
2160
3
نوفمبر 22
8366
0
ديسمبر 18
3562
3
سبتمبر 23
21028
2
أبريل 23
8439