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
""" Override search() to always show inactive children when searching via ``child_of`` operator. The ORM will
        always call search() with a simple domain of the form [('parent_id', 'in', [ids])]. """
        
        if len(args) == 1 and len(args[0]) == 3 and args[0][:2] == ('parent_id','in') \
                and args[0][2] != [False]:
            self = self.with_context(active_test=False)
        return super(Partner, self)._search(args, offset=offset, limit=limit, order=order,
                                            count=count, access_rights_uid=access_rights_uid)
    @api.model
    def name_search(self, name, args=None, operator='ilike', limit=100):
        if args is None:
            args = []
        if name and operator in ('=', 'ilike', '=ilike', 'like', '=like'):
            self.check_access_rights('read')
            where_query = self._where_calc(args)
            self._apply_ir_rules(where_query, 'read')
            from_clause, where_clause, where_clause_params = where_query.get_sql()
            where_str = where_clause and (" WHERE %s AND " % where_clause) or ' WHERE '
            
            search_name = name
            if operator in ('ilike', 'like'):
                search_name = '%%%s%%' % name
            if operator in ('=ilike', '=like'):
                operator = operator[1:]