'Update project_beneficiary project & location from project_location_id'

@staticmethod
def project_beneficiary_onaccept(form):

    db = current.db
    btable = db.project_beneficiary
    ltable = db.project_location
    record_id = form.vars.id
    query = ((btable.id == record_id) & (ltable.id == btable.project_location_id))
    project_location = db(query).select(ltable.project_id, ltable.location_id, limitby=(0, 1)).first()
    if project_location:
        db((btable.id == record_id)).update(project_id=project_location.project_id, location_id=project_location.location_id)
