mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
refactor(supplier): use frappe orm for criteria retrieval (#54841)
replace raw SQL with frappe.get_all in get_criteria_list to leverage the standard Frappe API. This improves code readability and follows framework best practices.
This commit is contained in:
@@ -55,17 +55,10 @@ class SupplierScorecardCriteria(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_criteria_list():
|
||||
criteria = frappe.db.sql(
|
||||
"""
|
||||
SELECT
|
||||
scs.name
|
||||
FROM
|
||||
`tabSupplier Scorecard Criteria` scs""",
|
||||
{},
|
||||
as_dict=1,
|
||||
)
|
||||
|
||||
return criteria
|
||||
"""
|
||||
Get the list of criteria
|
||||
"""
|
||||
return frappe.get_list("Supplier Scorecard Criteria", fields=["name"])
|
||||
|
||||
|
||||
def get_variables(criteria_name):
|
||||
|
||||
Reference in New Issue
Block a user