Skip to content

Commit

Permalink
fix: link call log to lead if lead is created from call log
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Jan 19, 2025
1 parent a242ef1 commit c6c0ef8
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crm/fcrm/doctype/crm_call_log/crm_call_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,9 @@ def create_lead_from_call_log(call_log):
lead.lead_owner = frappe.session.user
lead.save(ignore_permissions=True)

frappe.db.set_value(
"CRM Call Log",
call_log.get("name"),
{"reference_doctype": "CRM Lead", "reference_docname": lead.name},
)

if call_log.get("note"):
frappe.db.set_value(
"FCRM Note",
call_log.get("note"),
{"reference_doctype": "CRM Lead", "reference_docname": lead.name},
)
# link call log with lead
call_log = frappe.get_doc("CRM Call Log", call_log.get("name"))
call_log.link_with_reference_doc("CRM Lead", lead.name)
call_log.save(ignore_permissions=True)

return lead.name

0 comments on commit c6c0ef8

Please sign in to comment.