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:
Loïc Oberle
2026-05-11 17:57:10 +02:00
committed by GitHub
parent 2e958de95b
commit 1d5ef62452

View File

@@ -55,17 +55,10 @@ class SupplierScorecardCriteria(Document):
@frappe.whitelist() @frappe.whitelist()
def get_criteria_list(): def get_criteria_list():
criteria = frappe.db.sql( """
""" Get the list of criteria
SELECT """
scs.name return frappe.get_list("Supplier Scorecard Criteria", fields=["name"])
FROM
`tabSupplier Scorecard Criteria` scs""",
{},
as_dict=1,
)
return criteria
def get_variables(criteria_name): def get_variables(criteria_name):