Party mandatory message
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index 9418372..9223cdb 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -44,9 +44,12 @@
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
account_type = frappe.db.get_value("Account", self.account, "account_type")
- if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party):
- frappe.throw(_("Party Type and Party is required for Receivable / Payable account {0}").format(self.account))
-
+ if not (self.party_type and self.party):
+ if account_type == "Receivable":
+ frappe.throw(_("Customer is required against Receivable account {0}").format(self.account))
+ elif account_type == "Payable":
+ frappe.throw(_("Supplier is required against Payable account {0}").format(self.account))
+
# Zero value transaction is not allowed
if not (flt(self.debit) or flt(self.credit)):
frappe.throw(_("Either debit or credit amount is required for {0}").format(self.account))