strip all leading + trailing spaces from address elements
Related: OS#5414
This commit is contained in:
parent
9437a7c005
commit
d6ab23e8a1
|
@ -1,3 +1,4 @@
|
||||||
|
from six import string_types
|
||||||
from openerp import api, fields, models
|
from openerp import api, fields, models
|
||||||
import logging
|
import logging
|
||||||
from openerp.exceptions import Warning
|
from openerp.exceptions import Warning
|
||||||
|
@ -64,6 +65,11 @@ def build_sc_addr(partner):
|
||||||
if 'phone' in addr and len(addr['phone']) > 15:
|
if 'phone' in addr and len(addr['phone']) > 15:
|
||||||
addr['phone'] = ''.join(c for c in addr['phone'] if c.isdigit())
|
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
|
return addr
|
||||||
|
|
||||||
class SCDeliveryCarrier(models.Model):
|
class SCDeliveryCarrier(models.Model):
|
||||||
|
|
Loading…
Reference in New Issue