From 0b1567c51c2be5f83e1e38f98d8958120f5dcfe3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 3 Jun 2013 17:39:54 +0530 Subject: [PATCH] [docs] updated doctype generator, started page generator, and cleanups --- accounts/doctype/account/account.py | 5 ++++- accounts/page/accounts_browser/README.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 accounts/page/accounts_browser/README.md diff --git a/accounts/doctype/account/account.py b/accounts/doctype/account/account.py index bdc26e46ce..45b02a8d15 100644 --- a/accounts/doctype/account/account.py +++ b/accounts/doctype/account/account.py @@ -29,6 +29,7 @@ class DocType: self.nsm_parent_field = 'parent_account' def autoname(self): + """Append abbreviation to company on naming""" self.doc.name = self.doc.account_name.strip() + ' - ' + \ webnotes.conn.get_value("Company", self.doc.company, "abbr") @@ -37,6 +38,7 @@ class DocType: return {'address': address} def validate_master_name(self): + """Remind to add master name""" if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') \ and not self.doc.master_name: msgprint("Message: Please enter Master Name once the account is created.") @@ -62,6 +64,7 @@ class DocType: self.doc.debit_or_credit = par[0][3] def validate_max_root_accounts(self): + """Raise exception if there are more than 4 root accounts""" if webnotes.conn.sql("""select count(*) from tabAccount where company=%s and ifnull(parent_account,'')='' and docstatus != 2""", self.doc.company)[0][0] > 4: @@ -69,7 +72,6 @@ class DocType: raise_exception=1) def validate_duplicate_account(self): - if self.doc.fields.get('__islocal') or not self.doc.name: company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr") if sql("""select name from tabAccount where name=%s""", @@ -134,6 +136,7 @@ class DocType: self.doc.parent_account = '' def update_nsm_model(self): + """update lft, rgt indices for nested set model""" import webnotes import webnotes.utils.nestedset webnotes.utils.nestedset.update_nsm(self) diff --git a/accounts/page/accounts_browser/README.md b/accounts/page/accounts_browser/README.md new file mode 100644 index 0000000000..b8795613fc --- /dev/null +++ b/accounts/page/accounts_browser/README.md @@ -0,0 +1 @@ +Tree view browser for Chart of Accounts and Chart of Cost Centers \ No newline at end of file