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

hi

How can I call a function (like jinja) on t-field in xml? Can I do it in t-value?
For example I got a data field and when I want to represent it, I want to make some changes on showing of it.
If I wanted to use jinja I wrote {{ date_field | my_filter_function }} but it doesn't work in odoo!
Thanks for helping

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

Hi, 

To evaluate a function through XML you have to use "t-esc" instead of t-field in odoo, you can refer to additional qweb operations in the following links:             

1) Basic Qweb Operations in Odoo             

 2) https://www.odoo.com/documentation/16.0/developer/reference/frontend/qweb.html

Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 22
2252
1
thg 10 16
5459
1
thg 2 24
12847
0
thg 11 24
720
1
thg 5 15
5551