'Update the Commit Status for the Request Skill & Request'

@staticmethod
def commit_skill_onaccept(form):

    req_skill_id = form.vars.req_skill_id
    db = current.db
    rstable = db.req_req_skill
    req = db((rstable.id == req_skill_id)).select(rstable.req_id, limitby=(0, 1)).first()
    if (not req):
        return
    req_id = req.req_id
    query = ((rstable.req_id == req_id) & (rstable.deleted == False))
    rskills = db(query).select(rstable.id, rstable.skill_id, rstable.quantity)
    ctable = db.req_commit
    cstable = db.req_commit_skill
    query = (((ctable.req_id == req_id) & (cstable.commit_id == ctable.id)) & (cstable.deleted == False))
    cskills = db(query).select(cstable.skill_id, cstable.quantity)
    commit_qty = {}
    for skill in cskills:
        multi_skill_id = skill.skill_id
        for skill_id in multi_skill_id:
            if (skill_id in commit_qty):
                commit_qty[skill_id] += skill.quantity
            else:
                commit_qty[skill_id] = skill.quantity
    complete = False
    for skill in rskills:
        multi_skill_id = skill.skill_id
        quantity_commit = 0
        for skill_id in multi_skill_id:
            if (skill_id in commit_qty):
                if (commit_qty[skill_id] > quantity_commit):
                    quantity_commit = commit_qty[skill_id]
        db((rstable.id == skill.id)).update(quantity_commit=quantity_commit)
        req_quantity = skill.quantity
        if (quantity_commit >= req_quantity):
            complete = True
        else:
            complete = False
    rtable = db.req_req
    if complete:
        db((rtable.id == req_id)).update(commit_status=REQ_STATUS_COMPLETE)
    else:
        db((rtable.id == req_id)).update(commit_status=REQ_STATUS_PARTIAL)
