Trust-Code / l10n-brazil

módulos básicos a baixar para uso do OpenERP no Brasil, serve de base para NFe, SPED etc...
http://www.openerpbrasil.org
13 stars 5 forks source link

Rewrite module to V8.0 and add the remote search to ViaCEP.com when a ZIP Code is not found in the database #28

Closed wagnerpereirasp closed 8 years ago

wagnerpereirasp commented 9 years ago

This pull request is to completely adjust this module to V8.0 and make it search in www.viacep.com when a ZIP code is not found in the database, when that happens the code loads the new ZIP Code into the Database to be easily used in the future.

This allows the module to not need to have a full ZIP Code table loaded which would increase the download time and add the overhead to keep the database up-to-date.

It has one issue, I couldn't make a wizard to choose between a list of ZIP Codes when more than 1 is found by any reason (when searching by the ZIP Code or by Address), in that case I added a warning message for the user to be more specific, this needs to be complete in the future.