[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:
parent
d76cb7a3f1
commit
8558085634
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue