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

I am trying to hide the first two digits (country digits) of the vat field when I print a qweb report. Looking for the way to do it I have found this method:

t-esc="o.partner_id.vat[2:]"

But it's not working for me. I get an error:

QWebException: "vat[2:]" while evaluating


Maybe it's not the right way. Any solution is appreciated.



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

Your answer is partially correct.

You need to check whether vat is available for that partner before doing vat[2:]

    <h2 t-if="o.partner_id.vat">
      VAT: <span t-esc="o.partner_id.vat[2:]" />
</h2>

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

Thank you, t-if is needed to make it works.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 21
8088
2
thg 10 22
6485
Sum on QWeb reports Đã xử lý
3
thg 3 21
43969
1
thg 9 16
4074
0
thg 12 15
4428