From c874a82559d19f8006703abfffcfaa1ebcbe38ae Mon Sep 17 00:00:00 2001 From: mbauskar Date: Mon, 6 Feb 2017 15:41:06 +0530 Subject: [PATCH] [minor] index out of range fixes for JE --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index b31a304afb..5cf2d9277c 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -45,6 +45,9 @@ class JournalEntry(AccountsController): self.accounts = [account for account in self.accounts if not (account.debit_in_account_currency==0.0 and account.credit_in_account_currency==0.0)] + if not self.accounts: + frappe.throw("Debit or Credit amount is not found in account table") + def on_submit(self): self.check_credit_limit() self.make_gl_entries()