import xhiveframework


def execute():
	xhiveframework.reload_doc("maintenance", "doctype", "Maintenance Schedule Detail")
	xhiveframework.db.sql(
		"""
		UPDATE `tabMaintenance Schedule Detail`
		SET completion_status = 'Pending'
		WHERE docstatus < 2
	"""
	)
