msgprint fix, company abbreviation length validation

This commit is contained in:
Anand Doshi
2012-09-19 12:41:06 +05:30
parent 39ca69e978
commit 8bdfaa3438
4 changed files with 6 additions and 6 deletions

View File

@@ -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

View File

@@ -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)