import xhiveframework


def execute():
	"""Correct amount in child table of required items table."""

	xhiveframework.reload_doc("manufacturing", "doctype", "work_order")
	xhiveframework.reload_doc("manufacturing", "doctype", "work_order_item")

	xhiveframework.db.sql("""UPDATE `tabWork Order Item` SET amount = rate * required_qty""")
