From 1953f04e680d5b962cb73b2a06c878c08d602526 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:12:07 +0530 Subject: [PATCH] added validation that abbreviation should not be more than 5 characters when creating company --- erpnext/setup/doctype/company/company.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 38c689e0bc..cfa32bb0b9 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -37,6 +37,11 @@ convert_to_lists = webnotes.conn.convert_to_lists class DocType: def __init__(self,d,dl): self.doc, self.doclist = d,dl + + def validate(self): + if self.doc.__islocal and len(self.doc.abbr) > 5: + webnotes.msgprint("Abbreviation cannot have more than 5 characters", + raise_exception=1) # Create default accounts # ---------------------------------------------------