Skip to Content
Menú
This question has been flagged
2 Respostes
18082 Vistes

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
Descartar

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
Descartar

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
Descartar
Related Posts Respostes Vistes Activitat
0
de maig 22
2071
3
de nov. 22
8266
0
de des. 18
3490
3
de set. 23
20917
2
d’abr. 23
8352