Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] base_vat: fixes IndexError when entered VAT code is one symbol #14995

Merged
merged 1 commit into from Jan 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/base_vat/models/res_partner.py
Expand Up @@ -120,7 +120,7 @@ def default_vat_check(cn, vn):
# by default, a VAT number is valid if:
# it starts with 2 letters
# has more than 3 characters
return cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase
return len(cn) == 2 and cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase

vat_country, vat_number = self._split_vat(self.vat)
vat_no = "'CC##' (CC=Country Code, ##=VAT Number)"
Expand Down