From d4e59aa54fb86835fcbca83b21b1ccb705fec7c2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 9 Nov 2016 11:38:39 +0530 Subject: [PATCH] Update journal_entry.py --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 6c396ce4b6..55b9b7e3be 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -42,9 +42,8 @@ class JournalEntry(AccountsController): self.title = self.get_title() def clear_zero_debit_credit_row(self): - 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)] - frappe.db.sql("""delete from `tabJournal Entry Account` where parent = %s and debit = 0.0 and credit = 0.0""", self.name) - + 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)] def on_submit(self): self.check_credit_limit()