From 2b9448962ff9195bd6ffd535cee0f010876558d3 Mon Sep 17 00:00:00 2001 From: Kunhi Date: Fri, 17 Nov 2023 11:43:36 +0400 Subject: [PATCH] fix: Suppier name was not taken when creating address from supplier (cherry picked from commit 545ef3c23491e895bf288ddf7666ea80251b41e7) --- erpnext/selling/doctype/customer/customer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index ed9bc6dae862..ef42d8a6d446 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -692,10 +692,12 @@ def make_address(args, is_primary_address=1, is_shipping_address=1): title=_("Missing Values Required"), ) + party_name_key = "customer_name" if args.doctype == "Customer" else "supplier_name" + address = frappe.get_doc( { "doctype": "Address", - "address_title": args.get("customer_name"), + "address_title": args.get(party_name_key), "address_line1": args.get("address_line1"), "address_line2": args.get("address_line2"), "city": args.get("city"),