Restrict party to payable/receivable account

I recently identified an issue with how our Accounts team have been using ERPNext. When entering debit/credit notes they have been filling in the party for both the debit and credit side of the journal, which causes both to go onto the ledger for that supplier/customer. This in turn distorts the balance as it appears the document nets off to zero which is not correct.

I can’t think of any reason why you would want to put something onto a ledger that didn’t go through payables or receivables accounts. Therefore, I would like to be able to lock down the system so that it isn’t possible to post a journal with an account entry assigned to a party if the account is not a payables or receivables account.

Could you please post sample entry posted by your Accounts team to understand this better?

Why do they do it? are they both Liability or Asset accounts?