Skip to Content
Menu
This question has been flagged
2 Replies
18111 Zobrazenia

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?


Avatar
Zrušiť

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

Autor Best Answer

I solved. My question was answer. 

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


Avatar
Zrušiť

This is awesome!!! - Thanks!

Best Answer

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

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
máj 22
2087
3
nov 22
8285
0
dec 18
3511
3
sep 23
20950
2
apr 23
8373