'Override superclass method to use the person_id in
the master record instead of the master_id.
@param form: the master form
@param master_id: the ID of the master record in the form
@param format: the data format extension (for audit)'

def accept(self, form, master_id=None, format=None):

    s3db = current.s3db
    htable = s3db.hrm_human_resource
    query = (htable._id == master_id)
    master = current.db(query).select(htable.person_id, limitby=(0, 1)).first()
    if (not master):
        return False
    person_id = master.person_id
    return super(S3SQLHRPersonLink, self).accept(form, master_id=person_id, format=format)
