import influxframework


def execute():
	influxframework.reload_doc("crm", "doctype", "lead")
	influxframework.db.sql(
		"""
		UPDATE
			`tabLead`
		SET
			title = IF(organization_lead = 1, company_name, lead_name)
	"""
	)
