Odoo Help

0

Omit displaying first two digits VAT

By
Alex
on 3/30/15, 3:48 AM 962 views

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.



0

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.

Alex
on 3/30/15, 4:49 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 3/30/15, 3:48 AM
Seen: 962 times
Last updated: 3/30/15, 4:49 AM