truncate phone number if > 15 digits
This commit is contained in:
parent
997b465ea9
commit
6ac659a755
|
@ -59,6 +59,13 @@ class SCDeliveryCarrier(models.Model):
|
|||
addr['phone'] = partner.mobile
|
||||
elif partner.phone:
|
||||
addr['phone'] = partner.phone
|
||||
elif partner.parent_id and partner.parent_id.phone:
|
||||
addr['phone'] = partner.parent_id.phone
|
||||
|
||||
# We had trouble communicating with the carrier: ShipFrom phone number cannot be more than 15 digits long
|
||||
if 'phone' in addr and len(addr['phone']) > 15:
|
||||
addr['phone'] = ''.join(c for c in addr['phone'] if c.isdigit())
|
||||
|
||||
return addr
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in New Issue