import influxframework


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