fix: get scripts api
This commit is contained in:
parent
6ea4e985ef
commit
b03abdd2eb
17
crm/api/script.py
Normal file
17
crm/api/script.py
Normal file
@ -0,0 +1,17 @@
|
||||
import frappe
|
||||
from pypika import Criterion
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_scripts(doctype, view="Form"):
|
||||
Script = frappe.qb.DocType("CRM Form Script")
|
||||
query = (
|
||||
frappe.qb.from_(Script)
|
||||
.select("*")
|
||||
.where(Script.dt == doctype)
|
||||
.where(Script.view == view)
|
||||
.where(Script.enabled == 1)
|
||||
)
|
||||
|
||||
scripts = query.run(as_dict=True)
|
||||
return scripts
|
||||
Loading…
x
Reference in New Issue
Block a user