'We are on an entity (org/office) so we can fetch the entity
details from the request record.
@return: dictionary containing the ID and name of the entity'

def get_entity(self):

    entity = dict(id=int(self.request.record.pe_id))
    entity['name'] = current.s3db.pr_get_entities(pe_ids=[entity['id']], types=self.ENTITY_TYPES)[entity['id']]
    return entity
