Skip to content

Commit

Permalink
fix: issue occured when creating supplier with contact details
Browse files Browse the repository at this point in the history
(cherry picked from commit 7842c9f)

# Conflicts:
#	erpnext/selling/doctype/customer/customer.py
  • Loading branch information
kunhimohamed authored and mergify[bot] committed Dec 31, 2023
1 parent 88e5c9e commit b0666c4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions erpnext/selling/doctype/customer/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,12 @@ def make_contact(args, is_primary_contact=1):
"is_primary_contact": is_primary_contact,
"links": [{"link_doctype": args.get("doctype"), "link_name": args.get("name")}],
}
if args.customer_type == "Individual":
first, middle, last = parse_full_name(args.get("customer_name"))

party_type = args.customer_type if args.doctype == "Customer" else args.supplier_type
party_name_key = "customer_name" if args.doctype == "Customer" else "supplier_name"

if party_type == "Individual":
first, middle, last = parse_full_name(args.get(party_name_key))
values.update(
{
"first_name": first,
Expand All @@ -702,10 +706,15 @@ def make_contact(args, is_primary_contact=1):
else:
values.update(
{
<<<<<<< HEAD
"first_name": args.get("customer_name"),
"company_name": args.get("customer_name"),
=======
"company_name": args.get(party_name_key),
>>>>>>> 7842c9fba8 (fix: issue occured when creating supplier with contact details)
}
)

contact = frappe.get_doc(values)

if args.get("email_id"):
Expand Down

0 comments on commit b0666c4

Please sign in to comment.