'create or modify a partner from the point of sale ui.
partner contains the partner\'s fields.'

@api.model
def create_from_ui(self, partner):

    if partner.get('image'):
        partner['image'] = partner['image'].split(',')[1]
    partner_id = partner.pop('id', False)
    if partner_id:
        self.browse(partner_id).write(partner)
    else:
        partner['lang'] = self.env.user.lang
        partner_id = self.create(partner).id
    return partner_id
