Party mandatory message
This commit is contained in:
parent
e244cde9c3
commit
0a99b4347b
@ -44,8 +44,11 @@ class GLEntry(Document):
|
|||||||
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
|
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
|
||||||
|
|
||||||
account_type = frappe.db.get_value("Account", self.account, "account_type")
|
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):
|
if not (self.party_type and self.party):
|
||||||
frappe.throw(_("Party Type and Party is required for Receivable / Payable account {0}").format(self.account))
|
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
|
# Zero value transaction is not allowed
|
||||||
if not (flt(self.debit) or flt(self.credit)):
|
if not (flt(self.debit) or flt(self.credit)):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user