1
0
forked from test/crm
jcrm/crm/api/script.py
Shariq Ansari d1a15e97f1 fix: get scripts api
(cherry picked from commit b03abdd2eb523e17b62c34a5e2610387480c3847)
2025-05-09 14:55:46 +00:00

18 lines
349 B
Python

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