From f0eac4703726e00f151231b9694f40a4b8048520 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 (cherry picked from commit 0b91338771ad8201c95b3766babd070a9162c01f) --- 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 e4e2ee29d9b..ff8dec4db70 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -137,6 +137,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 cf9a7f02f9d..f0f492191fb 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -432,7 +432,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 {} @@ -454,7 +454,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) {