Browse Source

TypeError on name partner if byte found

12.0
Lara Baggio 4 years ago
parent
commit
bad40f1557
  1. 2
      partner_firstname/models/res_partner.py

2
partner_firstname/models/res_partner.py

@ -137,7 +137,7 @@ class ResPartner(models.Model):
""" """
try: try:
name = " ".join(name.split()) if name else name name = " ".join(name.split()) if name else name
except UnicodeDecodeError:
except (UnicodeDecodeError, TypeError):
# with users coming from LDAP, name can be a str encoded as utf-8 # with users coming from LDAP, name can be a str encoded as utf-8
# this happens with ActiveDirectory for instance, and in that case # this happens with ActiveDirectory for instance, and in that case
# we get a UnicodeDecodeError during the automatic ASCII -> Unicode # we get a UnicodeDecodeError during the automatic ASCII -> Unicode

Loading…
Cancel
Save