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
for partner in self:
            partner.company_type = 'company' if partner.is_company else 'person'
    def _write_company_type(self):
        for partner in self:
            partner.is_company = partner.company_type == 'company'
    @api.onchange('company_type')
    def onchange_company_type(self):
        self.is_company = (self.company_type == 'company')
    @api.multi
    def _update_fields_values(self, fields):
        """ Returns dict of write() values for synchronizing ``fields`` """
        values = {}
        for fname in fields:
            field = self._fields[fname]
            if field.type == 'many2one':
                values[fname] = self[fname].id
            elif field.type == 'one2many':
                raise AssertionError(_('One2Many fields cannot be synchronized as part of `commercial_fields` or `address fields`'))
            elif field.type == 'many2many':
                values[fname] = [(6, 0, self[fname].ids)]
            else:
                values[fname] = self[fname]
        return values
    @api.model
    def _address_fields(self):
        """Returns the list of address fields that are synced from the parent."""
        return list(ADDRESS_FIELDS)
    @api.multi
    def update_address(self, vals):