Browse Source

fix: specify fields to be set in Lead (#28288)

develop
Sagar Vora 3 years ago
committed by GitHub
parent
commit
da22744e0f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      erpnext/shopping_cart/cart.py

5
erpnext/shopping_cart/cart.py

@ -194,7 +194,9 @@ def add_new_address(doc):
def create_lead_for_item_inquiry(lead, subject, message): def create_lead_for_item_inquiry(lead, subject, message):
lead = frappe.parse_json(lead) lead = frappe.parse_json(lead)
lead_doc = frappe.new_doc('Lead') lead_doc = frappe.new_doc('Lead')
lead_doc.update(lead) for fieldname in ("lead_name", "company_name", "email_id", "phone"):
lead_doc.set(fieldname, lead.get(fieldname))
lead_doc.set('lead_owner', '') lead_doc.set('lead_owner', '')
if not frappe.db.exists('Lead Source', 'Product Inquiry'): if not frappe.db.exists('Lead Source', 'Product Inquiry'):
@ -202,6 +204,7 @@ def create_lead_for_item_inquiry(lead, subject, message):
'doctype': 'Lead Source', 'doctype': 'Lead Source',
'source_name' : 'Product Inquiry' 'source_name' : 'Product Inquiry'
}).insert(ignore_permissions=True) }).insert(ignore_permissions=True)
lead_doc.set('source', 'Product Inquiry') lead_doc.set('source', 'Product Inquiry')
try: try:

Loading…
Cancel
Save