mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: enabling lead even after "Opportunity" created against it (#34627)
* fix: enabling lead even after "Opportunity" created against it
* chore: Linting Issues
---------
Co-authored-by: Komal Saraf <komal@frappe.io>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit ad11934d39)
# Conflicts:
# erpnext/patches.txt
# erpnext/patches/v14_0/enable_all_leads.py
This commit is contained in:
@@ -33,7 +33,6 @@ class Opportunity(TransactionBase, CRMNote):
|
||||
def after_insert(self):
|
||||
if self.opportunity_from == "Lead":
|
||||
frappe.get_doc("Lead", self.party_name).set_status(update=True)
|
||||
self.disable_lead()
|
||||
|
||||
link_open_tasks(self.opportunity_from, self.party_name, self)
|
||||
link_open_events(self.opportunity_from, self.party_name, self)
|
||||
@@ -119,10 +118,6 @@ class Opportunity(TransactionBase, CRMNote):
|
||||
prospect.flags.ignore_mandatory = True
|
||||
prospect.save()
|
||||
|
||||
def disable_lead(self):
|
||||
if self.opportunity_from == "Lead":
|
||||
frappe.db.set_value("Lead", self.party_name, {"disabled": 1, "docstatus": 1})
|
||||
|
||||
def make_new_lead_if_required(self):
|
||||
"""Set lead against new opportunity"""
|
||||
if (not self.get("party_name")) and self.contact_email:
|
||||
|
||||
Reference in New Issue
Block a user