Impacted versions:11

Steps to reproduce:Add new address type "Other" and save, while saving partner it will give error

Current behavior:

Expected behavior:

Video/Screenshot link (optional):Error:
Odoo Server Error

Traceback (most recent call last):
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 646, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 307, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 339, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 332, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 927, in __call__
    return self.method(*args, **kw)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/http.py", line 512, in response_wrap
    response = f(*args, **kw)
  File "/home/p5q-pro/PycharmProjects/odoo11/addons/web/controllers/main.py", line 924, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/addons/web/controllers/main.py", line 916, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/addons/base/res/res_partner.py", line 514, in write
    result = result and super(Partner, self).write(vals)
  File "/home/p5q-pro/PycharmProjects/odoo11/addons/mail/models/mail_thread.py", line 277, in write
    result = super(MailThread, self).write(values)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/models.py", line 3011, in write
    self._write(old_vals)
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/models.py", line 3136, in _write
    field.write(self.with_context(rel_context), vals[name])
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/fields.py", line 2253, in write
    comodel.create(act[2])
  File "/home/p5q-pro/PycharmProjects/odoo11/odoo/addons/base/res/res_partner.py", line 530, in create
    vals['image'] = self._get_default_image(vals.get('type'), vals.get('is_company'), vals.get('parent_id'))
  File "/home/p5q-pro/PycharmProjects/odoo11/custom/tms/models/res_partner.py", line 46, in _get_default_image
    image = parent_image and parent_image.decode('base64') or None
LookupError: 'base64' is not a text encoding; use codecs.decode() to handle arbitrary codecs


odoo/addons/base/res/res_partner.py
unaccent = get_unaccent_wrapper(self.env.cr)
            query = """SELECT id
                         FROM res_partner
                      {where} ({email} {operator} {percent}
                           OR {display_name} {operator} {percent}
                           OR {reference} {operator} {percent}
                           OR {vat} {operator} {percent})
                           -- don't panic, trust postgres bitmap
                     ORDER BY {display_name} {operator} {percent} desc,
                              {display_name}
                    """.format(where=where_str,
                               operator=operator,
                               email=unaccent('email'),
                               display_name=unaccent('display_name'),
                               reference=unaccent('ref'),
                               percent=unaccent('%s'),
                               vat=unaccent('vat'),)
            where_clause_params += [search_name]*5
            if limit:
                query += ' limit %s'
                where_clause_params.append(limit)
            self.env.cr.execute(query, where_clause_params)
            partner_ids = [row[0] for row in self.env.cr.fetchall()]
            if partner_ids:
                return self.browse(partner_ids).name_get()
            else:
                return []
        return super(Partner, self).name_search(name, args, operator=operator, limit=limit)
    @api.model
    def find_or_create(self, email):