mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 22:05:19 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -83,7 +83,7 @@ class DocType:
|
||||
|
||||
# Account name must be unique
|
||||
def validate_duplicate_account(self):
|
||||
if (self.doc.__islocal or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
|
||||
if (self.doc.fields.get('__islocal') or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
|
||||
msgprint("Account Name already exists, please rename", raise_exception=1)
|
||||
|
||||
# validate root details
|
||||
|
||||
@@ -39,7 +39,7 @@ class DocType:
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
def validate(self):
|
||||
if self.doc.__islocal and len(self.doc.abbr) > 5:
|
||||
if self.doc.fields.get('__islocal') and len(self.doc.abbr) > 5:
|
||||
webnotes.msgprint("Abbreviation cannot have more than 5 characters",
|
||||
raise_exception=1)
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ class DocType(TransactionBase):
|
||||
|
||||
def check_if_last_visit(self):
|
||||
"""check if last maintenance visit against same sales order/ customer issue"""
|
||||
check_for_docname = check_for_doctype = None
|
||||
for d in getlist(self.doclist, 'maintenance_visit_details'):
|
||||
if d.prevdoc_docname:
|
||||
check_for_docname = d.prevdoc_docname
|
||||
|
||||
Reference in New Issue
Block a user