Browse Source

strip all leading + trailing spaces from address elements

Related: OS#5414
for/master
Harald Welte 9 months ago
parent
commit
d6ab23e8a1
  1. 6
      models/shipcloud_delivery_carrier.py

6
models/shipcloud_delivery_carrier.py

@ -1,3 +1,4 @@
from six import string_types
from openerp import api, fields, models
import logging
from openerp.exceptions import Warning
@ -64,6 +65,11 @@ def build_sc_addr(partner):
if 'phone' in addr and len(addr['phone']) > 15:
addr['phone'] = ''.join(c for c in addr['phone'] if c.isdigit())
# strip all leading or trailing spaces, see SYS#5414
for k in addr:
if isinstance(addr[k], string_types):
addr[k] = addr[k].strip()
return addr
class SCDeliveryCarrier(models.Model):

Loading…
Cancel
Save