From 1c94c42b281b9ed5abcb862e5dcd9c97791acb9e Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 1 Jun 2026 11:06:46 +0530 Subject: [PATCH] fix: pick correct name when creating user from RFQ (#55468) --- .../request_for_quotation/request_for_quotation.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py index 3ba026c8a81..3611bd244a6 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py @@ -6,6 +6,7 @@ import json import frappe from frappe import _ +from frappe.contacts.doctype.contact.contact import get_full_name from frappe.core.doctype.communication.email import make from frappe.desk.form.load import get_attachments from frappe.model.document import Document @@ -276,12 +277,20 @@ class RequestforQuotation(BuyingController): supplier_doc.save() def create_user(self, rfq_supplier, link): + contact_name = None + if rfq_supplier.contact: + name_fields = frappe.get_value( + "Contact", rfq_supplier.contact, ["first_name", "middle_name", "last_name"] + ) + if name_fields: + contact_name = get_full_name(*name_fields) + user = frappe.get_doc( { "doctype": "User", "send_welcome_email": 0, "email": rfq_supplier.email_id, - "first_name": rfq_supplier.supplier_name or rfq_supplier.supplier, + "first_name": contact_name or rfq_supplier.supplier_name or rfq_supplier.supplier, "user_type": "Website User", "redirect_url": link, }