Merge pull request #5896 from nabinhait/fix_112

[fix] repost gle only if there is any stock account without warehouse
diff --git a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
index ba1d067..174bb11 100644
--- a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
+++ b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
@@ -15,6 +15,8 @@
 		and (warehouse is null or warehouse = '')""")
 	if warehouses:
 		warehouses = set_warehouse_for_stock_account(warehouses)
+		if not warehouses:
+			return
 
 		stock_vouchers = frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
 			from `tabStock Ledger Entry` sle