From 3976e066e8ebfbf6e2048f227bc34596201ee8a6 Mon Sep 17 00:00:00 2001 From: Husam Hammad <85282854+husamhammad@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:19:39 +0300 Subject: [PATCH] fix: Handle None value in payment_term_outstanding V2 fix linting issue --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index a8c92aad5932..c3018cdfd4cb 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -281,7 +281,8 @@ def validate_allocated_amount_with_latest_data(self): d.payment_term and ( (flt(d.allocated_amount)) > 0 - and (not latest.payment_term_outstanding or flt(d.allocated_amount) > flt(latest.payment_term_outstanding)) + and latest.payment_term_outstanding + and (flt(d.allocated_amount) > flt(latest.payment_term_outstanding)) ) and self.term_based_allocation_enabled_for_reference(d.reference_doctype, d.reference_name) ):