Odoo Help


This community 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.


Omit displaying first two digits VAT

on 3/30/15, 3:48 AM 566 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:


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.


Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 3/30/15, 4:08 AM

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:]" />

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

on 3/30/15, 4:49 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


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