[FIX] base_vat: it allows to save a record if VAT for a country is not define

lp bug: https://launchpad.net/bugs/771664 fixed

bzr revid: mtr@mtr-20110429070623-qvalswfhwqlr6m50
This commit is contained in:
mtr 2011-04-29 12:36:23 +05:30
parent d76cb7a3f1
commit 8558085634
1 changed files with 5 additions and 0 deletions

View File

@ -63,6 +63,11 @@ class res_partner(osv.osv):
if not partner.vat:
continue
vat_country, vat_number = self._split_vat(partner.vat)
if not _ref_vat.has_key(vat_country):
country_code = vat_country.upper()
code = self.pool.get('res.country').search(cr, uid, [('code', '=', country_code)])
if code:
continue
if not hasattr(self, 'check_vat_' + vat_country):
return False
check = getattr(self, 'check_vat_' + vat_country)