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

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@naglis
naglis commented Jan 9, 2017

Description of the issue/feature this PR addresses:

This PR improves the default VAT code validation function in base_vat module, which assumes that at least two symbols will always be entered as the VAT code, and fails with an IndexError: string index out of range if only a single character is entered.

Current behavior before PR:

if a single character is entered as the VAT code, the validation fails with an IndexError: string index out of range.

Desired behavior after PR is merged:

when a single character is entered as the VAT code, the validation will fail with a proper informative message about invalid VAT code.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@naglis naglis [FIX] base_vat: fixes IndexError when entered VAT code is one symbol
1ff84e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment