diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index efc128aa0c5..32ea40bd9fb 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -60,7 +60,7 @@ def place_order(): quotation.flags.ignore_permissions = True quotation.submit() - if quotation.lead: + if quotation.quotation_to == 'Lead' and quotation.party_name: # company used to create customer accounts frappe.defaults.set_user_default("company", quotation.company)