[FIX]base_vat: ensure country_code is alphabetic

bzr revid: dle@openerp.com-20130521134231-fpsny6w54g3isg82
This commit is contained in:
dle@openerp.com 2013-05-21 15:42:31 +02:00
parent 39e99c1ce5
commit 0faa40aefb
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ class res_partner(osv.osv):
Check the VAT number depending of the country.
http://sima-pc.com/nif.php
'''
if not ustr(country_code).encode('utf-8').isalpha():
return False
check_func_name = 'check_vat_' + country_code
check_func = getattr(self, check_func_name, None) or \
getattr(vatnumber, check_func_name, None)