-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from shariquerik/custom-fields
feat: Custom fields
- Loading branch information
Showing
9 changed files
with
494 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
import json | ||
|
||
import frappe | ||
from frappe import _ | ||
from frappe.desk.form.load import get_docinfo | ||
|
||
|
||
@frappe.whitelist() | ||
def get_lead(name): | ||
Lead = frappe.qb.DocType("CRM Lead") | ||
|
||
query = ( | ||
frappe.qb.from_(Lead) | ||
.select("*") | ||
.where(Lead.name == name) | ||
.limit(1) | ||
) | ||
query = frappe.qb.from_(Lead).select("*").where(Lead.name == name).limit(1) | ||
|
||
lead = query.run(as_dict=True) | ||
if not len(lead): | ||
frappe.throw(_("Lead not found"), frappe.DoesNotExistError) | ||
lead = lead.pop() | ||
|
||
return lead | ||
return lead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.