def restock(inv_id): if request.method == 'POST': qty = request.form['qty'] r = Stock(quantity=qty, inventoryId=inv_id) r.create_record() flash('New stock successfully added!', 'success') return redirect(url_for('inventories'))
def add_stock(id): if request.method == 'POST': stock = request.form['stock'] new_stock = Stock(inv_id=id, stock=stock) new_stock.create_record() return redirect(url_for('inventories'))