import xhiveframework


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