Merge pull request #58489 from frappe/mergify/bp/version-16-hotfix/pr-58486

refactor(stock): use db.count for the empty ledger check (backport #58486)
This commit is contained in:
Sudharsanan Ashok
2026-08-27 16:50:09 +05:30
committed by GitHub

View File

@@ -1798,7 +1798,7 @@ class update_entries_after:
if not item_code or not warehouse or (item_code, warehouse) in self.prev_sle_dict:
return
if frappe.db.exists(
if frappe.db.count(
"Stock Ledger Entry", {"item_code": item_code, "warehouse": warehouse, "is_cancelled": 0}
):
return