[fix] [minor] Master name validation for customer/supplier/warehouse account
This commit is contained in:
parent
32803f8635
commit
40580d5d01
@ -38,9 +38,12 @@ class DocType:
|
||||
|
||||
def validate_master_name(self):
|
||||
"""Remind to add master name"""
|
||||
if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') \
|
||||
and not self.doc.master_name:
|
||||
msgprint("Message: Please enter Master Name once the account is created.")
|
||||
if self.doc.master_type in ('Customer', 'Supplier') or self.doc.account_type == "Warehouse":
|
||||
if not self.doc.master_name:
|
||||
msgprint(_("Please enter Master Name once the account is created."))
|
||||
elif not webnotes.conn.exists(self.doc.master_type or self.doc.account_type,
|
||||
self.doc.master_name):
|
||||
webnotes.throw(_("Invalid Master Name"))
|
||||
|
||||
def validate_parent(self):
|
||||
"""Fetch Parent Details and validation for account not to be created under ledger"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user