diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 454c7e1fb20..8d7e1e270e0 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -1443,17 +1443,8 @@ class InitSQLProceduresForAR: end; """ - def get_existing_procedures(self): - procedures = frappe.db.sql( - f"select routine_name from information_schema.routines where routine_type in ('FUNCTION','PROCEDURE') and routine_schema='{frappe.conf.db_name}';" - ) - if procedures: - # normalize - procedures = [x[0] for x in procedures] - return procedures - def __init__(self): - existing_procedures = self.get_existing_procedures() + existing_procedures = frappe.db.get_routines() if self.genkey_function_name not in existing_procedures: frappe.db.sql(self.genkey_function_sql)