brotherton-erpnext/erpnext/patches/v12_0/set_lead_title_field.py

12 lines
191 B
Python
Raw Normal View History

2019-09-06 08:08:15 +00:00
import frappe
def execute():
frappe.reload_doc("crm", "doctype", "lead")
frappe.db.sql("""
UPDATE
`tabLead`
SET
title = IF(organization_lead = 1, company_name, lead_name)
""")