From 0b91338771ad8201c95b3766babd070a9162c01f Mon Sep 17 00:00:00 2001 From: ljain112 Date: Mon, 10 Nov 2025 17:34:19 +0530 Subject: [PATCH] fix: add doctype parameter to lead details for correct company details --- erpnext/controllers/selling_controller.py | 1 + erpnext/crm/doctype/lead/lead.py | 4 ++-- erpnext/selling/doctype/quotation/quotation.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 8b0a0f19f9b..13def409606 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -141,6 +141,7 @@ class SellingController(StockController): lead, posting_date=self.get("transaction_date") or self.get("posting_date"), company=self.company, + doctype=self.doctype, ) ) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index a727ca3fead..38c001a877f 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -442,7 +442,7 @@ def _set_missing_values(source, target): @frappe.whitelist() -def get_lead_details(lead, posting_date=None, company=None): +def get_lead_details(lead, posting_date=None, company=None, doctype=None): if not lead: return {} @@ -464,7 +464,7 @@ def get_lead_details(lead, posting_date=None, company=None): } ) - set_address_details(out, lead, "Lead", company=company) + set_address_details(out, lead, "Lead", doctype=doctype, company=company) taxes_and_charges = set_taxes( None, diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index da8476d6b1f..f0061c016bd 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -252,6 +252,7 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext. lead: this.frm.doc.party_name, posting_date: this.frm.doc.transaction_date, company: this.frm.doc.company, + doctype: this.frm.doc.doctype, }, callback: function (r) { if (r.message) {