'Check the VAT number depending of the country.
http://sima-pc.com/nif.php'

@api.model
def simple_vat_check(self, country_code, vat_number):

    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))
    if (not check_func):
        if (country_code.upper() == 'EU'):
            return True
        return bool(self.env['res.country'].search([('code', '=ilike', country_code)]))
    return check_func(vat_number)
