fix: use query builder instead of raw SQL in unset_existing_data

This commit is contained in:
diptanilsaha
2025-08-16 22:15:55 +05:30
parent eb22794f14
commit 7fa4ed6139

View File

@@ -462,9 +462,8 @@ def unset_existing_data(company):
"Sales Taxes and Charges Template",
"Purchase Taxes and Charges Template",
]:
frappe.db.sql(
f'''delete from `tab{doctype}` where `company`="%s"''' % (company) # nosec
)
dt = frappe.qb.DocType(doctype)
frappe.qb.from_(dt).where(dt.company == company).delete().run()
def set_default_accounts(company):