From bad40f15571ae88ba2ea000b2d4121b4b4236014 Mon Sep 17 00:00:00 2001 From: Lara Baggio Date: Fri, 10 Jan 2020 13:01:08 +0100 Subject: [PATCH] TypeError on name partner if byte found --- partner_firstname/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_firstname/models/res_partner.py b/partner_firstname/models/res_partner.py index 7ad372d01..02b8de527 100644 --- a/partner_firstname/models/res_partner.py +++ b/partner_firstname/models/res_partner.py @@ -137,7 +137,7 @@ class ResPartner(models.Model): """ try: 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 # this happens with ActiveDirectory for instance, and in that case # we get a UnicodeDecodeError during the automatic ASCII -> Unicode