changeset ce5867056b29 in modules/stock_package_shipping_ups:default
details: 
https://hg.tryton.org/modules/stock_package_shipping_ups?cmd=changeset;node=ce5867056b29
description:
        Remove spaces from zip when set as PostalCode

        UPS does not allow spaces in PostalCode.

        issue9816
        review326541003
diffstat:

 stock.py                        |  2 +-
 tests/scenario_shipping_ups.rst |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 02338aa51d74 -r ce5867056b29 stock.py
--- a/stock.py  Mon Nov 02 16:16:11 2020 +0100
+++ b/stock.py  Mon Nov 16 21:23:36 2020 +0100
@@ -230,7 +230,7 @@
                 '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 -r 02338aa51d74 -r ce5867056b29 tests/scenario_shipping_ups.rst
--- a/tests/scenario_shipping_ups.rst   Mon Nov 02 16:16:11 2020 +0100
+++ b/tests/scenario_shipping_ups.rst   Mon Nov 16 21:23:36 2020 +0100
@@ -59,7 +59,7 @@
     >>> 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()

Reply via email to