Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
18200 Visualizzazioni

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
Abbandona

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

Autore Risposta migliore

I solved. My question was answer. 

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


Avatar
Abbandona

This is awesome!!! - Thanks!

Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mag 22
2172
3
nov 22
8375
0
dic 18
3572
3
set 23
21044
2
apr 23
8473