[FIX] base_vat_autocomplete: add compatibility with python-stdnum>=1.9
The `country_codes` variable was replaced by `_country_codes` at arthurdejong/python-stdnum@c113613b70 Make sure the syntax is the same Closes #24395
This commit is contained in:
@@ -12,6 +12,9 @@ _logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
import stdnum.eu.vat as stdnum_vat
|
||||
if not hasattr(stdnum_vat, "country_codes"):
|
||||
# stdnum version >= 1.9
|
||||
stdnum_vat.country_codes = stdnum_vat._country_codes
|
||||
except ImportError:
|
||||
_logger.warning('Python `stdnum` library not found, unable to call VIES service to detect address based on VAT number.')
|
||||
stdnum_vat = None
|
||||
|
||||
Reference in New Issue
Block a user