refactor: ignore mandatory for customer
This commit is contained in:
parent
49d51b8ce7
commit
8c24810f30
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user