Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
3889 Näkymät

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.



Avatar
Hylkää
Paras vastaus

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>

Avatar
Hylkää
Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
kesäk. 21
8088
2
lokak. 22
6485
3
maalisk. 21
43969
1
syysk. 16
4071
0
jouluk. 15
4428