From e999f4c1009a0db2323dfdb2673fff617e169926 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 2 Feb 2015 16:44:43 +0100 Subject: [PATCH] [FIX] base_vat: vat check for EU TIN. Foreign companies that trade with non-enterprises in the EU may have a VATIN starting with "EU" instead of a country code. See - http://en.wikipedia.org/wiki/VAT_identification_number - http://www.becompta.be/forums/tva/ndeg-tva-commencant-eu - http://www.bruynfico.be/index.php/7-droit-comptable/19-connexion-asp?idart=159 opw-621177 --- addons/base_vat/base_vat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py index 8ba25748317..1cf76c670e4 100644 --- a/addons/base_vat/base_vat.py +++ b/addons/base_vat/base_vat.py @@ -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)