frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.6k stars 7.29k forks source link

Quotations against Converted Leads #32100

Open hpotabatti opened 2 years ago

hpotabatti commented 2 years ago

There is no point in creating new Quotations against existing Converted Leads. In case we are approaching these Converted Leads for a new line of products or new products and need to send a Quotation, the user can create a New Lead/Opportunity based on the same.

turner-james commented 1 year ago

@hpotabatti When will someone be assigned to fix this problem. It is a problem and it should not be possible to continue creating quotations from converted Leads.

ankush commented 1 year ago
if doc.quotation_to == "Lead":
    lead = doc.party_name
    lead_status = frappe.db.get_value("Lead", doc.party_name, "status")

    if lead_status == "Converted":
        frappe.throw("Not allowed to create quotation against converted lead")

Can be easily handled with a server script like this. @turner-james

Hard-coding these validations in code is usually not a good idea because not everyone uses it in same way.