[FW][FIX] base_vat: support for 2020 Albanian Tax ID #114488
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue this PR addresses:
The first character of a Tax ID from Albania is a letter representing the decade in which it has been issued. The letter M represents the current decade. (This pdf explains in details how it is formated: https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Albania-TIN.pdf).
Currently the way Albanian Tax IDs are validated is through the python library
python-stdnum
. However, the regex that is used to validate them has not been updated since 2017. (I made a PR in its repo arthurdejong/python-stdnum#402 to fix that).The code from this commit is inspired by the one from that library, but the regex includes the letter M.
Current behavior before PR:
(
base_vat
must be installed)By going to Settings > Users & Companies > [A company]:
=> Error message
Forward-Port-Of: #114006