From 6480e028dd9fa1d618b4de14890abd75859fcfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 Nov 2020 21:23:36 +0100 Subject: [PATCH] Remove spaces from zip when set as PostalCode UPS does not allow spaces in PostalCode. issue9816 review326541003 --- stock.py | 2 +- tests/scenario_shipping_ups.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stock.py b/stock.py index be2830fd4f..0d2f17ad7f 100644 --- a/stock.py +++ b/stock.py @@ -230,7 +230,7 @@ class CreateShippingUPS(Wizard): 'AddressLine': [l[:35] for l in (address.street or '').splitlines()[:3]], 'City': address.city[:30], - 'PostalCode': (address.zip or '')[:9], + 'PostalCode': (address.zip or '').replace(' ', '')[:9], 'CountryCode': address.country.code if address.country else '', }, } diff --git a/tests/scenario_shipping_ups.rst b/tests/scenario_shipping_ups.rst index 1f396118a0..3cf0b7c5d3 100644 --- a/tests/scenario_shipping_ups.rst +++ b/tests/scenario_shipping_ups.rst @@ -59,7 +59,7 @@ Create parties:: >>> customer.save() >>> customer_address = customer.addresses.new() >>> customer_address.street = 'Anfield Road' - >>> customer_address.zip = 'L40TH' + >>> customer_address.zip = 'L 40TH' >>> customer_address.city = 'Liverpool' >>> customer_address.country = britain >>> customer_address.save()