Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
18180 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 22
2147
3
พ.ย. 22
8361
0
ธ.ค. 18
3556
3
ก.ย. 23
21015
t-att-href url get error แก้ไขแล้ว
2
เม.ย. 23
8431