mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
refactor(supplier_scorecard):replace sql with orm (#55161)
This commit is contained in:
@@ -89,19 +89,11 @@ class SupplierScorecard(Document):
|
|||||||
throw(_("Criteria weights must add up to 100%"))
|
throw(_("Criteria weights must add up to 100%"))
|
||||||
|
|
||||||
def calculate_total_score(self):
|
def calculate_total_score(self):
|
||||||
scorecards = frappe.db.sql(
|
scorecards = frappe.get_all(
|
||||||
"""
|
"Supplier Scorecard Period",
|
||||||
SELECT
|
fields=["name"],
|
||||||
scp.name
|
filters={"scorecard": self.name, "docstatus": 1},
|
||||||
FROM
|
order_by="end_date desc",
|
||||||
`tabSupplier Scorecard Period` scp
|
|
||||||
WHERE
|
|
||||||
scp.scorecard = %(sc)s
|
|
||||||
AND scp.docstatus = 1
|
|
||||||
ORDER BY
|
|
||||||
scp.end_date DESC""",
|
|
||||||
{"sc": self.name},
|
|
||||||
as_dict=1,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
period = 0
|
period = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user