mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
[fix] [minor] Master name validation for customer/supplier/warehouse account
This commit is contained in:
@@ -38,9 +38,12 @@ class DocType:
|
|||||||
|
|
||||||
def validate_master_name(self):
|
def validate_master_name(self):
|
||||||
"""Remind to add master name"""
|
"""Remind to add master name"""
|
||||||
if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') \
|
if self.doc.master_type in ('Customer', 'Supplier') or self.doc.account_type == "Warehouse":
|
||||||
and not self.doc.master_name:
|
if not self.doc.master_name:
|
||||||
msgprint("Message: Please enter Master Name once the account is created.")
|
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):
|
def validate_parent(self):
|
||||||
"""Fetch Parent Details and validation for account not to be created under ledger"""
|
"""Fetch Parent Details and validation for account not to be created under ledger"""
|
||||||
|
|||||||
Reference in New Issue
Block a user