'Update supply_distribution_item name from supply_item_id'

@staticmethod
def supply_distribution_item_onaccept(form):

    db = current.db
    dtable = db.supply_distribution_item
    ltable = db.supply_item
    record_id = form.vars.id
    query = ((dtable.id == record_id) & (ltable.id == dtable.item_id))
    item = db(query).select(dtable.name, ltable.name, limitby=(0, 1)).first()
    if (item and (not item[dtable.name])):
        db((dtable.id == record_id)).update(name=item[ltable.name])
    return
