mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 20:59:11 +00:00
refactor: ignore mandatory for customer
This commit is contained in:
@@ -77,6 +77,7 @@ def create_customer(user_details):
|
|||||||
customer = frappe.new_doc("Customer")
|
customer = frappe.new_doc("Customer")
|
||||||
customer.customer_name = user_details.fullname
|
customer.customer_name = user_details.fullname
|
||||||
customer.customer_type = "Individual"
|
customer.customer_type = "Individual"
|
||||||
|
customer.flags.ignore_mandatory = True
|
||||||
customer.insert(ignore_permissions=True)
|
customer.insert(ignore_permissions=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -91,7 +92,7 @@ def create_customer(user_details):
|
|||||||
"link_name": customer.name
|
"link_name": customer.name
|
||||||
})
|
})
|
||||||
|
|
||||||
contact.insert()
|
contact.save()
|
||||||
|
|
||||||
except frappe.DuplicateEntryError:
|
except frappe.DuplicateEntryError:
|
||||||
return customer.name
|
return customer.name
|
||||||
|
|||||||
Reference in New Issue
Block a user