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

@ -646,4 +646,5 @@ erpnext.patches.v12_0.set_payment_entry_status
erpnext.patches.v12_0.update_owner_fields_in_acc_dimension_custom_fields
erpnext.patches.v12_0.set_default_for_add_taxes_from_item_tax_template
erpnext.patches.v12_0.remove_denied_leaves_from_leave_ledger
erpnext.patches.v12_0.update_price_or_product_discount
erpnext.patches.v12_0.update_price_or_product_discount
erpnext.patches.v12_0.set_lead_title_field

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)
""")