SET_AGAINST_ACCOUNT of is a show stopper

Description of the issue’s self.set_against_account validation PREVENTS making a journal entry with thousands of items.

Context information (for bug reports)

lines 358 to 366 of erpnext/accounts/doctype/journal_entry/ file

	def set_against_account(self):
		accounts_debited, accounts_credited = [], []
		for d in self.get("accounts"):
			if flt(d.debit > 0): accounts_debited.append( or d.account)
			if flt( > 0: accounts_credited.append( or d.account)

		for d in self.get("accounts"):
			if flt(d.debit > 0): d.against_account = ", ".join(list(set(accounts_credited)))
			if flt( > 0): d.against_account = ", ".join(list(set(accounts_debited)))

While this looks like a a cute idea for providing info for every accounting entry, this is a SHOW STOPPER for an accounting entry (like opening balance, or closing entries, or other entries that require thousands of journal entry accounts in one entry).

Looking at the code above, you will realize that this UNNECESSARILY provides duplicate info for each entry, CONSUMES compute power, SLOWS DOWN processing, and in my case, stops me from making journal entries that require 2000 to 3000 journal entries. I commented out the code and the processing went so much faster.

I think it is better to DROP THIS set_against_accounts because it uncessary BLOATS the database, slows down processing, and prevents ENTERPRISE level accounting. Or maybe, it can be provided as an option where a checkbox in the settings will determine if this info is needed.