fix: specify fields to be set in Lead (#28288)
This commit is contained in:
parent
f57538bd2a
commit
da22744e0f
@ -194,7 +194,9 @@ def add_new_address(doc):
|
||||
def create_lead_for_item_inquiry(lead, subject, message):
|
||||
lead = frappe.parse_json(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', '')
|
||||
|
||||
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',
|
||||
'source_name' : 'Product Inquiry'
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
lead_doc.set('source', 'Product Inquiry')
|
||||
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user