Odoo Help

Welcome!

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.

0

VAT_BASE REMOVE CONTRY CODE

By
Antonio
on 11/25/13, 5:04 PM 1,581 views

Hi,

I live in croatia and we do not use the contry code before the vat number,

but we will, so i need to print out the invoices withouth the contry code

I know that i need to add some string on the report but i can not find the proper string to supress the first two letters

[[ (o.partner_id.vat) or removeParentNode('para') ]]

so if any one knows the answer, plesae be so kind and share it with me

Thanks

Please don't shout.

Daniel Reis
on 11/25/13, 6:50 PM
0
Timo Talvitie
On 11/25/13, 6:38 PM

Python has a handy slice syntax for removing certain characters from a string, maybe you could leave the base_vat module as it is and just reformat the variable for your reports? Here's a basic example of how the slicing works...

Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> croatian_vat = 'HR12345678901'
>>> croatian_vat = croatian_vat[2:]
>>> print croatian_vat
12345678901
>>>
0
Antonio
On 11/26/13, 2:37 AM

Thanks for your answer, becose i am new in the python, i don't know how to write it properly,

the string line is from the report

[[ (o.partner_id.vat) or removeParentNode('para') ]]

I have tried to add the "(:2)" but it will not display at all on the report,

my idea was to slice only the first two letters on the report

thanks

i got it to work

[[ (o.partner_id.vat[-11:]) or removeParentNode('para') ]]

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)

Stats

Asked: 11/25/13, 5:04 PM
Seen: 1581 times
Last updated: 3/16/15, 8:10 AM