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

Hi,

return self.env['report'].get_action(self, 'my_module_my_template', data=datas)

I passed python dictionary in data. But it is None  when I print in Xml.

<t t-esc="data"/>

Can anyone explain how can I solve this ? 


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

First check in python, 

print datas

check any entries in datas,
if yes, 

data['form']['department']

Use like this, its may works,

<t t-if="data['form']['department']">
<h3><t t-esc="data['form']['department']"/></h3>
</t>


Ảnh đại diện
Huỷ bỏ
Tác giả

I have tried this. data is considered as None Type

do make print in the python?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
1864
2
thg 3 25
2433
4
thg 11 24
7831
1
thg 3 24
2715
3
thg 9 23
25692