fix: issue occured when creating supplier with contact details
(cherry picked from commit 7842c9fba8b521b9ba7f65281c4f2384f62b06e1)
This commit is contained in:
parent
d89a9a5bfd
commit
aaccfeb918
@ -644,8 +644,12 @@ def make_contact(args, is_primary_contact=1):
|
|||||||
"is_primary_contact": is_primary_contact,
|
"is_primary_contact": is_primary_contact,
|
||||||
"links": [{"link_doctype": args.get("doctype"), "link_name": args.get("name")}],
|
"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(
|
values.update(
|
||||||
{
|
{
|
||||||
"first_name": first,
|
"first_name": first,
|
||||||
@ -656,9 +660,10 @@ def make_contact(args, is_primary_contact=1):
|
|||||||
else:
|
else:
|
||||||
values.update(
|
values.update(
|
||||||
{
|
{
|
||||||
"company_name": args.get("customer_name"),
|
"company_name": args.get(party_name_key),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
contact = frappe.get_doc(values)
|
contact = frappe.get_doc(values)
|
||||||
|
|
||||||
if args.get("email_id"):
|
if args.get("email_id"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user