'returns the new values when partner_id has changed'

def _onchange_partner_id_values(self, partner_id):

    if partner_id:
        partner = self.env['res.partner'].browse(partner_id)
        partner_name = partner.parent_id.name
        if ((not partner_name) and partner.is_company):
            partner_name = partner.name
        return {'partner_name': partner_name, 'contact_name': (partner.name if (not partner.is_company) else False), 'title': partner.title.id, 'street': partner.street, 'street2': partner.street2, 'city': partner.city, 'state_id': partner.state_id.id, 'country_id': partner.country_id.id, 'email_from': partner.email, 'phone': partner.phone, 'mobile': partner.mobile, 'fax': partner.fax, 'zip': partner.zip, 'function': partner.function}
    return {}
