fix: get scripts api
(cherry picked from commit b03abdd2eb523e17b62c34a5e2610387480c3847)
This commit is contained in:
parent
c521ec299b
commit
d1a15e97f1
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