Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
18162 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
2136
3
nov 22
8337
0
dic 18
3551
3
set 23
21002
2
apr 23
8424