From 08abf960472671da6cbb4a4d7495f136dee14786 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 17 Jun 2026 19:01:37 +0530 Subject: [PATCH] refactor(postgres): port Fiscal Year doctype queries to the query builder Co-Authored-By: Claude Opus 4.8 (1M context) --- erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 52fe3cd148c..553f8d8d9d5 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -72,10 +72,8 @@ class FiscalYear(Document): if existing_fiscal_years: for existing in existing_fiscal_years: - company_for_existing = frappe.db.sql_list( - """select company from `tabFiscal Year Company` - where parent=%s""", - existing.name, + company_for_existing = frappe.get_all( + "Fiscal Year Company", filters={"parent": existing.name}, pluck="company" ) overlap = False