تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3899 أدوات العرض

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 21
8089
2
أكتوبر 22
6485
Sum on QWeb reports تم الحل
3
مارس 21
43969
1
سبتمبر 16
4074
0
ديسمبر 15
4428