Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
18174 Vues

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
Ignorer

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

Auteur Meilleure réponse

I solved. My question was answer. 

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


Avatar
Ignorer

This is awesome!!! - Thanks!

Meilleure réponse

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

Avatar
Ignorer
Publications associées Réponses Vues Activité
0
mai 22
2144
3
nov. 22
8358
0
déc. 18
3552
3
sept. 23
21009
2
avr. 23
8428