patch: set title for old leads

This commit is contained in:
Rohan Bansal
2019-09-06 13:38:15 +05:30
parent 75da5af900
commit 69e3868a9d
2 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
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)
""")