|
@ -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: |
|
|