Example #1
0
def lookup_product(product_name):
    #Get the Item
    #items = Item.all(qb=qb_client)
    item_count = Item.count("Name = '" + product_name + "'", qb=qb_client)
    if item_count == 1:
        items = Item.where("Name = '" + product_name + "'", qb=qb_client)
        return items[0].Id
    else:
        logging.error("Product name: [{}] not found. Please add this product to quickbook before this record can be added".format(product_name))