Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3887 มุมมอง

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.



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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>

อวตาร
ละทิ้ง
ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
QWEB: Place full width image on page แก้ไขแล้ว
1
มิ.ย. 21
8088
2
ต.ค. 22
6485
Sum on QWeb reports แก้ไขแล้ว
3
มี.ค. 21
43969
1
ก.ย. 16
4071
0
ธ.ค. 15
4428