base_vat : Skips the vat validation if VAT contains false country code
Bug #567216 reported by
Carlos Liebana
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Invalid
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi,
VAT validation is not working correct, at least in the last version 5.0.9, but maybe since 5.0.6. In a clean installation with base vat installed, I can introduce a string like "ttsscff4554" and it's saving the changes. If I change that for "EStts..." it shows the pop-up error. I think that all the strings that don't begin with two country representative characters are saved.
Best regards.
Changed in openobject-addons: | |
importance: | Undecided → Medium |
milestone: | none → 5.0.11 |
status: | New → Confirmed |
summary: |
- base_vat is not working right + base_vat : Skips the vat validation if VAT contains false country code |
To post a comment you must log in.
If you see the code in partner.py line 55 of base_vat module, there is a function called default_vat_check, it acts when the two first letters of the vat doesn't match on any check_vat_ countyletters function.
def default_ vat_check( self, cn, vn): ascii_lowercase and cn[1] in string. ascii_lowercase
# by default, a VAT number is valid if:
# it starts with 2 letters
# has more than 3 characters
return len(vn) > 0 and len(cn) == 2 and cn[0] in string.
IMHO is better return False than perform this check...