fix: Suppier name was not taken when creating address from supplier

This commit is contained in:
Kunhi 2023-11-17 11:43:36 +04:00 committed by GitHub
parent 7842c9fba8
commit 545ef3c234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -677,10 +677,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"),