Browse Source

[FIX] set countrycode in upper case to avoid error with the lib phonenumbers

pull/62/head
Benoit Guillot 9 years ago
parent
commit
4baf917d4f
  1. 2
      base_phone/base_phone.py

2
base_phone/base_phone.py

@ -90,7 +90,7 @@ class PhoneCommon(models.AbstractModel):
init_value = vals.get(field) init_value = vals.get(field)
try: try:
res_parse = phonenumbers.parse( res_parse = phonenumbers.parse(
vals.get(field), countrycode)
vals.get(field), countrycode.upper())
vals[field] = phonenumbers.format_number( vals[field] = phonenumbers.format_number(
res_parse, phonenumbers.PhoneNumberFormat.E164) res_parse, phonenumbers.PhoneNumberFormat.E164)
if init_value != vals[field]: if init_value != vals[field]:

Loading…
Cancel
Save