import influxframework


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

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

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