Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
18088 Prikazi

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
Opusti

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

Avtor 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
Opusti

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
maj 22
2071
3
nov. 22
8272
0
dec. 18
3493
3
sep. 23
20927
2
apr. 23
8356