'Set the doc_id to that of the HRM, so that it also appears there'

@staticmethod
def hrm_appraisal_document_onaccept(form):

    db = current.db
    s3db = current.s3db
    atable = db.hrm_appraisal
    ltable = db.hrm_appraisal_document
    htable = s3db.hrm_human_resource
    query = ((((ltable.id == form.vars.id) & (ltable.appraisal_id == atable.id)) & (atable.person_id == htable.person_id)) & (htable.deleted != False))
    row = db(query).select(htable.doc_id, ltable.document_id, limitby=(0, 1)).first()
    if row:
        document_id = row['hrm_appraisal_document.document_id']
        doc_id = row['hrm_human_resource.doc_id']
        db((db.doc_document.id == document_id)).update(doc_id=doc_id)
