[fix] Setup Wizard: use correct customer, supplier name in create contact. Fixes #4804.
This commit is contained in:
parent
efef236fdf
commit
c83802fae1
@ -372,7 +372,7 @@ def create_customers(args):
|
|||||||
customer = args.get("customer_" + str(i))
|
customer = args.get("customer_" + str(i))
|
||||||
if customer:
|
if customer:
|
||||||
try:
|
try:
|
||||||
frappe.get_doc({
|
doc = frappe.get_doc({
|
||||||
"doctype":"Customer",
|
"doctype":"Customer",
|
||||||
"customer_name": customer,
|
"customer_name": customer,
|
||||||
"customer_type": "Company",
|
"customer_type": "Company",
|
||||||
@ -383,7 +383,7 @@ def create_customers(args):
|
|||||||
|
|
||||||
if args.get("customer_contact_" + str(i)):
|
if args.get("customer_contact_" + str(i)):
|
||||||
create_contact(args.get("customer_contact_" + str(i)),
|
create_contact(args.get("customer_contact_" + str(i)),
|
||||||
"customer", customer)
|
"customer", doc.name)
|
||||||
except frappe.NameError:
|
except frappe.NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ def create_suppliers(args):
|
|||||||
supplier = args.get("supplier_" + str(i))
|
supplier = args.get("supplier_" + str(i))
|
||||||
if supplier:
|
if supplier:
|
||||||
try:
|
try:
|
||||||
frappe.get_doc({
|
doc = frappe.get_doc({
|
||||||
"doctype":"Supplier",
|
"doctype":"Supplier",
|
||||||
"supplier_name": supplier,
|
"supplier_name": supplier,
|
||||||
"supplier_type": _("Local"),
|
"supplier_type": _("Local"),
|
||||||
@ -401,7 +401,7 @@ def create_suppliers(args):
|
|||||||
|
|
||||||
if args.get("supplier_contact_" + str(i)):
|
if args.get("supplier_contact_" + str(i)):
|
||||||
create_contact(args.get("supplier_contact_" + str(i)),
|
create_contact(args.get("supplier_contact_" + str(i)),
|
||||||
"supplier", supplier)
|
"supplier", doc.name)
|
||||||
except frappe.NameError:
|
except frappe.NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user