This question has been flagged
2 Replies
16018 Views

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
Discard

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

Author 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
Discard

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
Discard