Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
17868 Zobrazení

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šit

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

Autor Nejlepší odpověď

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šit

This is awesome!!! - Thanks!

Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
kvě 22
1921
3
lis 22
8060
0
pro 18
3292
3
zář 23
20615
2
dub 23
8094