From 3ebfad711572dc629d3f2aed4a4c36c9e7a08181 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 1 Jun 2015 14:01:43 +0530 Subject: [PATCH] minor fixes --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 3 ++- erpnext/hr/doctype/leave_allocation/leave_allocation.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 1e2b352d4e..1f296e5fa7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -81,7 +81,8 @@ class JournalEntry(AccountsController): frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx)) def check_credit_limit(self): - customers = list(set([d.party for d in self.get("accounts") if d.party_type=="Customer" and flt(d.debit) > 0])) + customers = list(set([d.party for d in self.get("accounts") + if d.party_type=="Customer" and d.party and flt(d.debit) > 0])) if customers: from erpnext.selling.doctype.customer.customer import check_credit_limit for customer in customers: diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index 272ec3996b..4e74b2846d 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -23,9 +23,6 @@ class LeaveAllocation(Document): def on_update(self): self.get_total_allocated_leaves() - def on_cancel(self): - self.check_for_leave_application() - def validate_new_leaves_allocated_value(self): """validate that leave allocation is in multiples of 0.5""" if flt(self.new_leaves_allocated) % 0.5: