Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] base_vat: Fixing DNI validation #292

Closed CarmenMiranda closed 2 years ago

CarmenMiranda commented 5 years ago

Current behavior before PR:

Right now when we check the vat in Peru, there is no validation for the vat type DNI.

Desired behavior after PR is merged:

When we validate the vat, we are going to have a validation, and if we put an invalid DNI it's going to be shown a message like this one:

The VAT number [%s] for partner [%s] does not seem to be valid. Note: the expected format is

  • PER10254824220
  • PED10254824
  • PEE102548242201
  • PEPPERU10254
  • PEC102548242201234
  • PEB102548242201234
  • PET102548242201234
  • PEI102548242201234
  • PEA102548242201234
CarmenMiranda commented 5 years ago

@umiphos

umiphos commented 5 years ago

I'm going to search a bit more about another source, but this is oficial and they take the DNI value as an int of length 8 http://www2.sunat.gob.pe/pdt/pdtModulos/independientes/p695/TipoDoc.htm

moylop260 commented 5 years ago

Please, check if stdnum has this validation in order to justify this change:

CarmenMiranda commented 5 years ago

@umiphos The changes are ready

CarmenMiranda commented 5 years ago

@umiphos I think it's ready (: