Help

0

How to call model objects at xml qweb?

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?


1 Comment
Avatar
Discard
Avatar
Hilar Andikkadavath
-

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

1 Answer
8
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>


3 Comments
Avatar
Discard
Avatar
Hilar Andikkadavath
-

Good !

Avatar
Nilmar Shereef
-

Nice :D

Avatar
Ray Carnes
-

This is awesome!!! - Thanks!