[MERGE] forward port of branch 7.0 up to e999f4c

This commit is contained in:
Christophe Simonis 2015-02-03 15:53:01 +01:00
commit dce1b83785
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,10 @@ class res_partner(osv.osv):
getattr(vatnumber, check_func_name, None)
if not check_func:
# No VAT validation available, default to check that the country code exists
if country_code.upper() == 'EU':
# Foreign companies that trade with non-enterprises in the EU
# may have a VATIN starting with "EU" instead of a country code.
return True
res_country = self.pool.get('res.country')
return bool(res_country.search(cr, uid, [('code', '=ilike', country_code)], context=context))
return check_func(vat_number)