Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Last active January 4, 2016 08:19
Show Gist options
  • Save ecarreras/8594529 to your computer and use it in GitHub Desktop.
Save ecarreras/8594529 to your computer and use it in GitHub Desktop.
import vatnumber
partners = O.ResPartner.search_reader([('vat', '!=', False)], ['vat'])
for p in partners:
if not vatnumber.check_vat(p['vat']):
new_vat = ''.join([x for x in p['vat'] if x.isalnum()])
if not vatnumber.check_vat(new_vat):
print new_vat
else:
#O.ResPartner.write([p['id']], {'vat': new_vat})
print "Ara es valid"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment