From 1d5ef6245248205ab87c140a23d0fe9db6cd88b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Oberle?= Date: Mon, 11 May 2026 17:57:10 +0200 Subject: [PATCH] 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. --- .../supplier_scorecard_criteria.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py index c406739dad7..5bdad172ae6 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py @@ -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):