Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
18166 Lượt xem

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?


Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất

I solved. My question was answer. 

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


Ảnh đại diện
Huỷ bỏ

This is awesome!!! - Thanks!

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 22
2140
3
thg 11 22
8356
0
thg 12 18
3552
3
thg 9 23
21003
2
thg 4 23
8424