diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 466b2f9b21..79ca322cac 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -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 diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index cfa32bb0b9..4386f2e60a 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -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) diff --git a/public/js/all-app.js b/public/js/all-app.js index 6c564045b9..7fef076408 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -603,14 +603,14 @@ document.body.appendChild(temp);temp.submit();return temp;} /* * lib/js/legacy/utils/msgprint.js */ -var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v)msgprint(v);}) +var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v){msgprint(v);}}) return;} if(typeof(msg)!='string') msg=JSON.stringify(msg);if(msg.substr(0,8)=='__small:'){show_alert(msg.substr(8));return;} if(!msg_dialog){msg_dialog=new wn.ui.Dialog({title:"Message",onhide:function(){msg_dialog.msg_area.empty();}});msg_dialog.msg_area=$('
|
|