Merge pull request #4582 from nabinhait/develop

Chart of accounts added for Singapore and some other fixes
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index cc6157f..a8ebbea 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -23,6 +23,8 @@
 			frappe.db.get_value("Company", self.company, "abbr")
 
 	def validate(self):
+		if frappe.local.flags.allow_unverified_charts:
+			return
 		self.validate_parent()
 		self.validate_root_details()
 		self.set_root_and_report_type()
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index e1f9f1c..91469d9 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -8,7 +8,7 @@
 
 def create_charts(chart_name, company):
 	chart = get_chart(chart_name)
-
+	
 	if chart:
 		accounts = []
 
@@ -40,9 +40,9 @@
 						"account_currency": frappe.db.get_value("Company", company, "default_currency")
 					})
 
-					if root_account:
+					if root_account or frappe.local.flags.allow_unverified_charts:
 						account.flags.ignore_mandatory = True
-
+						
 					account.insert()
 
 					accounts.append(account_name_in_db)
@@ -67,13 +67,17 @@
 		from erpnext.accounts.doctype.account.chart_of_accounts.verified import standard_chart_of_accounts
 		return standard_chart_of_accounts.get()
 	else:
-		path = os.path.join(os.path.dirname(__file__), "verified")
-		for fname in os.listdir(path):
-			if fname.endswith(".json"):
-				with open(os.path.join(path, fname), "r") as f:
-					chart = f.read()
-					if chart and json.loads(chart).get("name") == chart_name:
-						return json.loads(chart).get("tree")
+		folders = ("verified",)
+		if frappe.local.flags.allow_unverified_charts:
+			folders = ("verified", "unverified")
+		for folder in folders:
+			path = os.path.join(os.path.dirname(__file__), folder)
+			for fname in os.listdir(path):
+				if fname.endswith(".json"):
+					with open(os.path.join(path, fname), "r") as f:
+						chart = f.read()
+						if chart and json.loads(chart).get("name") == chart_name:
+							return json.loads(chart).get("tree")
 
 @frappe.whitelist()
 def get_charts_for_country(country):
@@ -82,11 +86,7 @@
 	def _get_chart_name(content):
 		if content:
 			content = json.loads(content)
-
-			if frappe.local.flags.allow_unverified_charts:
-				charts.append(content["name"])
-
-			elif content and content.get("is_active", "No") == "Yes" and content.get("disabled", "No") == "No":
+			if content and content.get("disabled", "No") == "No":
 				charts.append(content["name"])
 
 	country_code = frappe.db.get_value("Country", country, "code")
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
index 489bba7..3b07d51 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "at",
     "name": "Austria - Chart of Accounts",
-	"is_active": "Yes",
     "tree": {
         "Summe Abschreibungen und Aufwendungen": {
             "7010 bis 7080 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {},
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json
index c7e7db8..051e554 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "be",
     "name": "Belgian PCMN",
-	"disabled": "Yes",
     "tree": {
         "CLASSE 1": {
             "BENEFICE (PERTE) REPORTE(E)": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json
index 3942871..65f5f3b 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "br",
     "name": "Planilha de Contas Brasileira",
-	"is_active": "No",
     "tree": {
         "ATIVO": {
             "CIRCULANTE": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json
index 3b2e7ff..ed4cd40 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json
@@ -1,7 +1,6 @@
 {
     "country_code": "ca",
     "name": "Chart of Accounts for english-speaking provinces",
-	"is_active": "Yes",
     "tree": {
         "ASSETS": {
             "CURRENT ASSETS": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json
index 676e3ec..41fe453 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json
@@ -1,7 +1,6 @@
 {
     "country_code": "ca",
     "name": "Plan comptable pour les provinces francophones",
-	"is_active": "Yes",
     "tree": {
         "ACTIF": {
             "ACTIFS COURANTS": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json
index a6c1440..f8d467c 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "ch",
     "name": "Plan comptable STERCHI",
-	"is_active": "Yes",
 	"disabled": "Yes",
     "tree": {
         "Actif": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json
index f2e973f..4ac3465 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "co",
     "name": "Unique Account Chart - PUC",
-	"is_active": "Yes",
     "tree": {
         "ACTIVO": {
             "DEUDORES": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json
index cb1f54d..f81d1e3 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json
@@ -1,7 +1,6 @@
 {
     "country_code": "cr",
     "name": "Costa Rica - Company 0",
-	"is_active": "Yes",
     "tree": {
         "0-Activo": {
             "0-Activo circulante": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json
index 0257d05..a36586e 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json
@@ -1,7 +1,6 @@
 {
     "country_code": "cr",
     "name": "Costa Rica - Company 1",
-	"is_active": "Yes",
     "tree": {
         "xActivo": {
             "root_type": "Asset",
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json
index f4d1fcc..c8ed2ee 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json
@@ -1,7 +1,7 @@
 {
     "country_code": "de",
     "name": "Deutscher Kontenplan SKR04",
-	"is_active": "Yes",
+	"disabled": "Yes",
     "tree": {
         "Bilanz - Aktiva": {
             "Anlageverm\u00f6gen": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json
index 4b16c86..2f9782a 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "de",
     "name": "Deutscher Kontenplan SKR03",
-	"is_active": "No",
 	"disabled": "Yes",
     "tree": {
         "Aktiva": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json
index 5c70ee2..122edaa 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json
@@ -1,6 +1,7 @@
 {
     "country_code": "es", 
     "name": "PGCE com\u00fan", 
+	"disabled": "Yes",
     "tree": {
         "Acreedores y deudores por operaciones comerciales": {
             "Acreedores varios": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json
index 71a39df..d7b1964 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json
@@ -1,7 +1,6 @@
 {
     "country_code": "et",
     "name": "Ethiopia Tax and Account Chart Template",
-	"is_active": "Yes",
     "tree": {
         "ASSETS": {
             "Cash and Cash Equivalents": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json
index 8f8e777..5b4f352 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json
@@ -1,7 +1,6 @@
 {
     "country_code": "gt",
     "name": "Plantilla de cuentas de Guatemala (sencilla)",
-	"is_active": "Yes",
     "tree": {
         "Activo": {
             "Activo Corriente": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json
index 34caff6..1c06a2e 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json
@@ -1,7 +1,6 @@
 {
     "country_code": "hn",
     "name": "Plantilla de cuentas de Honduras (sencilla)",
-	"is_active": "Yes",
     "tree": {
         "Activo": {
             "Activo Corriente": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json
index 1dc5293..c304684 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json
@@ -1,6 +1,7 @@
 {
     "country_code": "lu", 
     "name": "PCMN Luxembourg", 
+	"disabled": "Yes",
     "tree": {
         "TOTAL CLASSES 1 A 5": {
             "CLASSE 1 - COMPTES DE CAPITAUX, DE PROVISIONS ET DE DETTES FINANCIERES": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json
index 59809c9..de16044 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "pa",
     "name": "Plan de Cuentas",
-	"is_active": "Yes",
     "tree": {
         "ACTIVOS": {
             "Activo Fijo": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json
index 64f5412..ef43897 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json
@@ -1,6 +1,7 @@
 {
     "country_code": "ro",
     "name": "Romania - Chart of Accounts",
+	"disabled": "Yes",
     "tree": {
         "CONTURI FINANCIARE": {
             "CONTURI DE BILANT": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json
deleted file mode 100644
index e46f317..0000000
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json
+++ /dev/null
@@ -1,223 +0,0 @@
-{
-    "country_code": "sg",
-    "name": "Singapore Chart of Accounts",
-	"is_active": "Yes",
-    "tree": {
-        "Assets": {
-            "Cash and cash equivalents": {
-                "Cash on hand": {
-                    "account_type": "Cash"
-                },
-                "Client trust account": {
-                    "account_type": "Cash"
-                },
-                "Current": {
-                    "account_type": "Bank"
-                },
-                "Money market": {
-                    "account_type": "Cash"
-                },
-                "Rents held in trust": {
-                    "account_type": "Cash"
-                },
-                "Savings": {
-                    "account_type": "Cash"
-                },
-                "account_type": "Cash"
-            },
-            "Current assets": {
-                "Allowance for bad debts": {},
-                "Development costs": {},
-                "Employee cash advances": {},
-                "Inventory": {},
-                "Investments - other": {},
-                "Loans to officers": {},
-                "Loans to others": {},
-                "Loans to shareholders": {},
-                "Other Current Assets": {},
-                "Prepaid expenses": {},
-                "Retainage": {},
-                "Undeposited funds": {}
-            },
-            "Non-current assets": {
-                "Accumulated amortization of non-current assets": {},
-                "Available-for-sale financial assets": {},
-                "Deferred tax": {},
-                "Goodwill": {},
-                "Intangible Assets": {},
-                "Investments": {},
-                "Lease Buyout": {},
-                "Licences": {},
-                "Organisational costs": {},
-                "Other intangible assets": {},
-                "Other non-current assets": {},
-                "Prepayments and accrued income": {},
-                "Security Deposits": {}
-            },
-            "Property, plant and equipment": {
-                "Accumulated amortisation": {},
-                "Accumulated depletion": {},
-                "Accumulated depreciation": {},
-                "Buildings": {},
-                "Depletable assets": {},
-                "Furniture and fixtures": {},
-                "Leasehold improvements": {},
-                "Machinery and equipment": {},
-                "Other Assets": {},
-                "Vehicles": {}
-            },
-            "Purchase Tax Receivable": {
-                "Purchase Tax Account 0% EP": {},
-                "Purchase Tax Account 0% ME": {},
-                "Purchase Tax Account 0% NR": {},
-                "Purchase Tax Account 0% OP": {},
-                "Purchase Tax Account 0% ZP": {},
-                "Purchase Tax Account 7% BL": {},
-                "Purchase Tax Account 7% IM": {},
-                "Purchase Tax Account 7% TX-E33": {},
-                "Purchase Tax Account 7% TX-N33": {},
-                "Purchase Tax Account 7% TX-RE": {},
-                "Purchase Tax Account 7% TX7": {},
-                "Purchase Tax Account MES": {}
-            },
-            "Trade and other receivable": {
-                "Other Receivable Account": {
-                    "account_type": "Receivable"
-                },
-                "Trade Receivable Account": {
-                    "account_type": "Receivable"
-                },
-                "account_type": "Receivable"
-            },
-			"root_type": "Asset"
-        },
-        "Liabilities": {
-            "Current liabilities": {
-                "Client Trust Accounts - Liabilities": {},
-                "Current Tax Liability": {},
-                "Current portion of employee benefits obligations": {},
-                "Current portion of obligations under finance leases": {},
-                "GST Payable": {},
-                "Insurance Payable": {},
-                "Interest payables": {},
-                "Line of Credit": {},
-                "Loan Payable": {},
-                "Payroll Clearing": {},
-                "Payroll liabilities": {},
-                "Prepaid Expenses Payable": {},
-                "Provision for warranty obligations": {},
-                "Rents in trust - Liability": {},
-                "Short term borrowings": {}
-            },
-            "Equity": {
-                "Accumulated Adjustment": {},
-                "Opening Balance Equity": {},
-                "Ordinary shares": {},
-                "Owner's Equity": {},
-                "Paid-in capital or surplus": {},
-                "Partner's Equity": {},
-                "Preferred shares": {},
-                "Retained Earnings": {},
-                "Share capital": {},
-                "Treasury Shares": {}
-            },
-            "Non-current liabilities": {
-                "Accruals and Deferred Income": {},
-                "Bank loans": {},
-                "Long term borrowings": {},
-                "Long term employee benefit obligations": {},
-                "Notes Payable": {},
-                "Obligations under finance leases": {},
-                "Other non-current liabilities": {},
-                "Shareholder Notes Payable": {}
-            },
-            "Sale Tax Payables": {
-                " Sales Tax Account 0% ES33": {},
-                "Sales Tax Account 0% ESN33": {},
-                "Sales Tax Account 0% OS": {},
-                "Sales Tax Account 0% ZR": {},
-                "Sales Tax Account 7% DS": {},
-                "Sales Tax Account 7% SR": {}
-            },
-            "Trade and other payables": {
-                "Other Payable Account": {
-                    "account_type": "Payable"
-                },
-                "Trade Payable Account": {
-                    "account_type": "Payable"
-                },
-                "account_type": "Payable"
-            },
-			"root_type": "Liability"
-        },
-        "Cost of sales": {
-            "Cost of Good Sold": {
-                "Cost of Labour - COS": {},
-                "Equipment rental - COS": {},
-                "Freight and delivery - COS": {},
-                "Other costs of sales - COS": {},
-                "Supplies and materials - COS": {}
-            },
-			"root_type": "Expense"
-        },
-        "Income": {
-            "Other revenue": {
-                "Dividend revenue": {},
-                "Gain/loss on sale of fixed assets or investments": {},
-                "Interest earned": {},
-                "Other investment revenue": {},
-                "Other miscellaneous revenue": {},
-                "Tax-exempt interest": {}
-            },
-            "Revenue": {
-                "Discounts/refunds given": {},
-                "Non-profit revenue": {},
-                "Other primary revenue": {},
-                "Sales of product revenue": {},
-                "Service/fee revenue": {},
-                "Unapplied cash payment income": {}
-            },
-			"root_type": "Income"
-        },
-        "Indirect Expenses": {
-            "Expenses": {
-                "Administrative expenses": {},
-                "Advertising/promotional": {},
-                "Auto": {},
-                "Bad debts": {},
-                "Bank charges": {},
-                "Charitable contributions": {},
-                "Cost of labour": {},
-                "Distribution costs": {},
-                "Dues and subscriptions": {},
-                "Entertainment": {},
-                "Equipment rental": {},
-                "Finance costs": {},
-                "Insurance": {},
-                "Interest paid": {},
-                "Legal and professional fees": {},
-                "Meals and entertainment": {},
-                "Other miscellaneous service cost": {},
-                "Payroll expenses": {},
-                "Promotional meals": {},
-                "Rent or lease of buildings": {},
-                "Repair and maintenance": {},
-                "Shipping, freight, and delivery": {},
-                "Supplies": {},
-                "Taxes paid": {},
-                "Travel": {},
-                "Travel meals": {},
-                "Unapplied cash bill payment expense": {},
-                "Utilities": {}
-            },
-            "Other Expenses": {
-                "Amortisation": {},
-                "Depreciation": {},
-                "Exchange Gain or Loss": {},
-                "Other Expense": {},
-                "Penalties and settlements": {}
-            },
-			"root_type": "Expense"
-        }
-    }
-}
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json
index 443054e..3f687dc 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json
@@ -1,6 +1,7 @@
 {
     "country_code": "si", 
     "name": "Kontni na\u010drt za gospodarske dru\u017ebe", 
+	"disabled": "Yes",
     "tree": {
         "DOLGORO\u010cNA SREDSTVA": {
             "DANA DOLGORO\u010cNA POSOJILA IN TERJATVE ZA NEVPLA\u010cANI VPOKLICANI KAPITAL": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json
index 6e8ff71..dffcf35 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json
@@ -1,7 +1,6 @@
 {
     "country_code": "th",
     "name": "Thailand Chart of Accounts",
-	"is_active": "Yes",
     "tree": {
         "Assets": {
             "Account Receivable": {},
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json
index 326fa65..04633cc 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json
@@ -1,7 +1,6 @@
 {
     "country_code": "uy",
     "name": "Plan de Cuentas",
-	"is_active": "Yes",
     "tree": {
         "ACTIVO": {
             "ACTIVO CORRIENTE": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
index 1ba0931..734e4d0 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
@@ -1,7 +1,6 @@
 {
     "country_code": "ae",
     "name": "U.A.E Chart of Accounts",
-	"is_active": "Yes",
     "tree": {
         "Assets": {
             "Current Assets": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json
index ceb37cc..81c4fdf 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json
@@ -1,7 +1,6 @@
 {
   "country_code": "gt",
   "name": "Cuentas de Guatemala",
-  "is_active": "Yes",
   "tree": {
     "Activos": {
       "Activo Corriente": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
index 254e2b7..c300894 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
@@ -1,7 +1,6 @@
 {
     "country_code": "in",
     "name": "Chart of Accounts - India",
-	"is_active": "Yes",
     "tree": {
 	    "Application of Funds (Assets)": {
 	        "Current Assets": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json
index bea2c6d..d55b77e 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json
@@ -1,7 +1,6 @@
 {
 	"country_code": "ni",
 	"name": "Catalogo de Cuentas Nicaragua",
-	"is_active": "Yes",
 	"tree": {
 		"Activo": {
 			"Activo Corriente": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json
new file mode 100644
index 0000000..a62be37
--- /dev/null
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json
@@ -0,0 +1,273 @@
+{
+	"country_code": "sg",
+	"name": "Singapore Default Chart of Accounts",
+	"tree": {
+		"Assets": {
+			"Current assets": {
+				"Accounts Receivable": {
+					"Credit Cards": {
+						"AMEX Receivable": {},
+						"CUP Receivale": {},
+						"MC Receivable": {},
+						"NETS Receivable": {},
+						"VISA Receivable": {}
+					},
+					"Debtors": {
+						"account_type": "Receivable"
+					}
+				},
+				"Bank Accounts": {
+					"Paypal Account": {
+						"account_type": "Bank"
+					},
+					"account_type": "Bank"
+				},
+				"Cash in Hand": {
+					"Cash in Transit": {
+						"account_type": "Cash"
+					},
+					"Petty Cash": {
+						"account_type": "Cash"
+					}
+				},
+				"Loans and Advances-Assets": {
+					"Prepayments": {}
+				},
+				"Securities and Deposits": {
+					"Bank Guarantees": {},
+					"Bank Deposits": {},
+					"Rental Deposits": {}
+				},
+				"Stock Assets": {
+					"account_type": "Stock",
+					"is_group": 1
+				},
+				"Tax Assets": {
+					"GST-Input": {}
+				}
+			},
+			"Non-current assets": {
+				"Fixed Assets": {
+					"Accumulated Depreciation": {
+						"AccDep-Equipment-ICT": {},
+						"AccDep-Furniture and Fixtures": {},
+						"AccDep-Equipment-Office": {},
+						"AccDep-Motor Vehicle": {},
+						"AccDep-Plant and Machinery": {}
+					},
+					"Equipment-ICT": {},
+					"Furniture and Fixtures": {},
+					"Equipment-Office": {},
+					"Motor Vehicle": {},
+					"Plant and Machinery": {}
+				},
+				"Non-Fixed Assets": {
+					"Goodwill": {},
+					"Investments": {
+						"Investments-Associated Company": {},
+						"Investments-Subsidiary": {}
+					}
+				},
+				"Shares": {
+					"Shares-Quoted": {},
+					"Shares-Unquoted": {}
+				}
+			},
+			"Temporary Accunts": {
+				"Temporary Opening": {
+					"account_type": "Temporary"
+				}
+			},
+			"root_type": "Asset"
+		},
+		"Liabilities": {
+			"Current liabilities": {
+				"Accounts Payable": {
+					"Creditors":{
+						"account_type": "Payable"
+					}
+			 	},
+			 	"Duties and Taxes": {
+					"account_type": "Tax",
+					"Deferred Tax Liabilities-Current": {},
+					"GST-Output": {},
+					"Income Tax Payable": {}
+				},
+				"Loans-Current": {
+					"Amount Owing to Directors": {},
+					"Bank Overdaft Account": {},
+					"Secured Loans": {},
+					"Unsecured Loans": {}
+				},
+				"Provision and Accruals": {
+					"Accruals": {
+					  "Accr-CPF": {},
+					  "Accr-Sundry": {},
+					  "Accr-Withholding Tax": {}
+					},
+					"Provisions": {
+						"Prov-Audit Fee": {},
+						"Prov-Others": {},
+						"Prov-Tax Fee": {},
+						"Prov-Bonus": {
+						  "Prov-Bonus-Executive": {},
+						  "Prov-Bonus-Non Executive": {}
+						}
+					}
+				},
+				"Sponsorship Funds": {},
+				"Stock Liabilities": {
+					"Stock Received But Not Billed": {
+					       "account_type": "Stock Received But Not Billed"
+					}
+				}
+			},
+			"Non-current liabilities": {
+				"Deferred Tax Liabilities": {},
+				"Loans-Non Current": {}
+			},
+			"Capital Account": {
+				"Reserves and Surplus": {},
+				"Shareholder Funds": {}
+			},
+		"root_type": "Liability"
+		},
+		"Equity": {
+			"Share Capital": {},
+			"Current Year Earnings": {},
+			"Proposed Dividends": {},
+			"Retained Earnings": {},
+			"root_type": "Equity"
+		},
+		"Income": {
+			"Direct Income": {
+				"Management Income": {},
+				"Sales Income": {}
+			},
+			"Indirect Income": {
+				"Government Grants": {},
+				"Interest Income": {
+			"Current Account Interest Earned": {},
+			"Fixed Deposit Interest Earned": {}
+				},
+				"Other Income": {},
+				"Service Charges": {}
+			},
+			"root_type": "Income"
+		},
+		"Expenses": {
+			"Expenses-Administrative": {
+				"Audit Fees": {},
+				"Bank charges and interest": {},
+				"Currency Exchange Differences": {},
+				"Insurance": {},
+				"Interest on Loan": {},
+				"Legal and Professional Fees": {},
+				"Loss on Disposal of FA": {},
+				"Postal and Courier Charges": {},
+				"Printing and Stationery": {},
+				"Secretarial Fees": {},
+				"Tax Agent Fees": {}
+			},
+			"Expenses-Direct": {
+				"Cost of Goods Sold": {
+					"account_type": "Cost of Goods Sold"
+				},
+				"Cost of Sales": {},
+				"Expenses Included in Valuation": {
+					"account_type": "Expenses Included In Valuation"
+				},
+				"Stock Adjustment": {
+					"account_type": "Stock Adjustment"
+				}
+			},
+			"Expenses-Marketing": {
+				"Advertising and Promotion": {},
+				"Graphic Design Fees": {},
+				"Internet Marketing": {}
+			},
+			"Expenses-Operating": {
+				"Cleaning Costs": {},
+				"Commission Charges": {
+					"Comm-Credit Card": {},
+					"Comm-NETS": {},
+					"Comm-Paypal": {}
+				},
+				"Communication Costs": {
+				  "Internet Connection": {},
+				  "Telephone Costs": {}
+				},
+				"Entertainment Expenses": {},
+				"General Expenses": {},
+			   "Licence Fees": {},
+			   "Rental Costs": {
+					"Rental-Premises": {},
+					"Rental-Equipment": {},
+					"Rental-Storage": {}
+				},
+				"Repairs and Maintenance": {
+					"R&M-ICT": {},
+					"R&M-Building": {},
+					"R&M-Fixtures & Furniture": {},
+					"R&M-Office": {},
+					"R&M-Plant & Machinery": {}
+				},
+				"Service Fees": {},
+				"Subscription Fees": {
+					"Publication Subscriptions": {},
+					"TV Subscriptions": {}
+				},
+				"Travel Expenses": {},
+				"Utilities": {
+					"Utility-Electricity": {},
+					"Utility-Gas": {},
+					"Utility-Refuse Removal": {},
+					"Utility-Water": {}
+				}
+			},
+			"Expenses-Other": {
+				"Bad Debts Written Off": {},
+				"Depreciation": {
+					"Dep-ICT Equipment": {},
+					"Dep-Fixtures & Furniture": {},
+					"Dep-Motor Vehicle": {},
+					"Dep-Office Equipment": {},
+					"Dep-Plant & Machinery": {},
+					"Dep-Renovation": {}
+				},
+				"Donations": {},
+				"Round Off": {},
+				"Tax Expenses": {
+					"Tax Expenses": {}
+				}
+			},
+			"Expenses-Staff": {
+				"Bonuses": {
+					"Bonus-Executive": {},
+					"Bonus-Non Executive": {},
+					"Bonus-Performance": {}
+				},
+				"CPF": {},
+				"Directors Fees": {},
+				"FWL": {},
+				"Incentives": {},
+				"Medical Expenses": {},
+				"Salaries": {
+					"Casual Labour": {},
+					"Salary-Executive": {},
+					"Salary-Non Executive-Full Time": {},
+					"Salary-Non Executive-Part Time": {}
+				},
+				"SDF": {},
+				"Security Expenses": {},
+				"Staff Advertising": {},
+				"Staff Commission Paid": {},
+				"Staff Meals": {},
+				"Staff Training": {},
+				"Staff Transport": {},
+				"Staff Welfare": {}
+			},
+			"root_type": "Expense"
+		}
+	}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json
new file mode 100644
index 0000000..fb84f20
--- /dev/null
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json
@@ -0,0 +1,343 @@
+{
+	"country_code": "sg",
+	"name": "Singapore F&B Chart of Accounts",
+	"tree": {
+		"Assets": {
+			"Current assets": {
+				"Accounts Receivable": {
+					"Credit Cards": {
+						"AMEX Receivable": {},
+						"CUP Receivale": {},
+						"MC Receivable": {},
+						"NETS Receivable": {},
+						"VISA Receivable": {}
+					},
+					"Debtors": {
+						"account_type": "Receivable"
+					}
+				},
+				"Bank Accounts": {
+					"Paypal Account": {
+						"account_type": "Bank"
+					},
+					"account_type": "Bank"
+				},
+				"Cash in Hand": {
+					"Cash in Transit": {
+						"account_type": "Cash"
+					},
+					"Petty Cash": {
+						"account_type": "Cash"
+					}
+				},
+				"Loans and Advances-Assets": {
+					"Prepayments": {}
+				},
+				"Securities and Deposits": {
+					"Bank Guarantees": {},
+					"Bank Deposits": {},
+					"Rental Deposits": {}
+				},
+				"Stock Assets": {
+					"account_type": "Stock",
+					"is_group": 1
+				},
+				"Tax Assets": {
+					"GST-Input": {}
+				}
+			},
+			"Non-current assets": {
+				"Fixed Assets": {
+					"Accumulated Depreciation": {
+						"AccDep-Equipment-AV": {},
+						"AccDep-Equipment-Bar": {},
+						"AccDep-Equipment-ICT": {},
+						"AccDep-Equipment-Electrical": {},
+						"AccDep-Furniture and Fixtures": {},
+						"AccDep-Equipment-Kitchen": {},
+						"AccDep-Equipment-Lighting": {},
+						"AccDep-Equipment-Office": {},
+						"AccDep-Motor Vehicle": {},
+						"AccDep-Plant and Machinery": {},
+						"AccDep-Renovation": {}
+					},
+					"Equipment-AV": {},
+					"Equipment-Bar": {},
+					"Equipment-ICT": {},
+					"Equipment-Electrical": {},
+					"Furniture and Fixtures": {},
+					"Equipment-Kitchen": {},
+					"Equipment-Lighting": {},
+					"Equipment-Office": {},
+					"Motor Vehicle": {},
+					"Plant and Machinery": {},
+					"Renovation": {}
+				},
+				"Non-Fixed Assets": {
+					"Goodwill": {},
+					"Investments": {
+						"Investments-Associated Company": {},
+						"Investments-Subsidiary": {}
+					}
+				},
+				"Shares": {
+					  "Shares-Quoted": {},
+					  "Shares-Unquoted": {}
+				}
+			},
+			"Temporary Accunts": {
+				"Temporary Opening": {
+					"account_type": "Temporary"
+				}
+			},
+			"root_type": "Asset"
+		},
+		"Liabilities": {
+			"Current liabilities": {
+				"Accounts Payable": {
+					"Creditors":{
+						"account_type": "Payable"
+					}
+			 	},
+			 	"Duties and Taxes": {
+					"account_type": "Tax",
+					"Deferred Tax Liabilities-Current": {},
+					"GST-Output": {},
+					"Income Tax Payable": {}
+				},
+				"Loans-Current": {
+					"Amount Owing to Directors": {},
+					"Bank Overdaft Account": {},
+					"Secured Loans": {},
+					"Unsecured Loans": {}
+				},
+				"Provision and Accruals": {
+					"Accruals": {
+						"Accr-CPF": {},
+						"Accr-Incentives": {},
+						"Accr-OCR Employee Card": {},
+						"Accr-Paypal Credit": {},
+						"Accr-Sundry": {},
+						"Accr-Tips": {},
+						"Accr-Withholding Tax": {}
+					},
+					"Provisions": {
+						"Prov-Audit Fee": {},
+						"Prov-Others": {},
+						"Prov-Tax Fee": {},
+						"Prov-Bonus": {
+							"Prov-Bonus-Executive": {},
+							"Prov-Bonus-Non Executive": {}
+						}
+					}
+				},
+				"Sponsorship Funds": {},
+				"Stock Liabilities": {
+					"Stock Received But Not Billed": {
+						"account_type": "Stock Received But Not Billed"
+					}
+				}
+			},
+			"Non-current liabilities": {
+				"Deferred Tax Liabilities": {},
+				"Loans-Non Current": {}
+			},
+			"Capital Account": {
+				"Reserves and Surplus": {},
+				"Shareholder Funds": {}
+			},
+		"root_type": "Liability"
+		},
+		"Equity": {
+			"Share Capital": {},
+			"Current Year Earnings": {},
+			"Proposed Dividends": {},
+			"Retained Earnings": {},
+			"root_type": "Equity"
+		},
+		"Income": {
+			"Direct Income": {
+				"Management Income": {},
+				"Sales Income": {
+					"Sales-Food": {},
+					"Sales-Beverage": {},
+					"Sales-Events and Functions": {},
+					"Sales-Merchandise": {},
+					"Sales-Pool Tables": {},
+					"Sales-Tobacco": {},
+					"Sales-Rental": {}
+				}
+			},
+			"Indirect Income": {
+				"Government Grants": {},
+				"Interest Income": {
+					"Current Account Interest Earned": {},
+					"Fixed Deposit Interest Earned": {}
+				},
+				"Other Income": {},
+				"Service Charges": {}
+			},
+			"root_type": "Income"
+		},
+		"Expenses": {
+			"Expenses-Administrative": {
+				"Admin Management Fees": {},
+				"Audit Fees": {},
+				"Auto": {},
+				"Bank charges and interest": {},
+				"Currency Exchange Differences": {},
+				"Insurance": {},
+				"Interest on Loan": {},
+				"Legal and Professional Fees": {},
+				"Loss on Disposal of FA": {},
+				"Postal and Courier Charges": {},
+				"Printing and Stationery": {},
+				"Secretarial Fees": {},
+				"Tax Agent Fees": {}
+			},
+			"Expenses-Direct": {
+				"Cost of Goods Sold": {
+					"account_type": "Cost of Goods Sold"
+				},
+				"Cost of Sales": {
+					"COS-Food": {},
+					"COS-Beverage": {},
+					"COS-Tobacco": {},
+					"COS-Events and Functions": {},
+					"COS-Merchandise": {}
+				},
+				"Expenses Included in Valuation": {
+					"account_type": "Expenses Included In Valuation"
+				},
+				"Stock Adjustment": {
+					"account_type": "Stock Adjustment"
+				}
+			},
+			"Expenses-Marketing": {
+				"Advertising and Promotion": {},
+				"Graphic Design Fees": {},
+				"Internet Marketing": {
+					"Marketing-Social Media": {},
+					"Marketing-Website": {}
+				}
+			},
+			"Expenses-Operating": {
+				"Cleaning Costs": {
+					"Cleaning-Kitchen": {},
+					"Cleaning-Laundry": {},
+					"Cleaning-Outlet": {}
+				},
+				"Commission Charges": {
+					"Comm-Credit Card": {},
+					"Comm-NETS": {},
+					"Comm-Paypal": {}
+				},
+				"Communication Costs": {
+					  "Internet Connection": {},
+					  "Telephone Costs": {}
+				},
+				"Disposals": {
+					"Disposals-Food": {},
+					"Disposals-Beverage": {},
+					"Disposals-Merchandise": {},
+					"Disposals-Others": {}
+				},
+				"Entertainment Expenses": {
+					"DJ Costs": {},
+					"Live Band Costs": {},
+					"Recorded Music Costs": {}
+				},
+				"FoC Accounts": {
+					"FoC-ENT": {},
+					"FoC-OC": {}
+				},
+				"General Expenses": {},
+				"Landscaping Costs": {},
+				"Licence Fees": {},
+				"Operational Supplies": {
+					"Supplies-Bar": {},
+					"Supplies-Guest": {},
+					"Supplies-Kitchen": {},
+					"Supplies-Restaurant": {},
+					"Supplies-Stewarding": {}
+				},
+				"Rental Costs": {
+					"Rental-Premises": {},
+					"Rental-Equipment": {},
+					"Rental-Storage": {}
+				},
+				"Repairs and Maintenance": {
+					"R&M-ICT": {},
+					"R&M-AV": {},
+					"R&M-Building": {},
+					"R&M-Electrical & Lighting": {},
+					"R&M-Fixtures & Furniture": {},
+					"R&M-Kitchen & Bar": {},
+					"R&M-Office": {},
+					"R&M-Plant & Machinery": {}
+				},
+				"Service Fees": {},
+				"Subscription Fees": {
+					"Publication Subscriptions": {},
+					"TV Subscriptions": {}
+				},
+				"Travel Expenses": {},
+				"Utilities": {
+					"Utility-Electricity": {},
+					"Utility-Gas": {},
+					"Utility-Refuse Removal": {},
+					"Utility-Water": {}
+				}
+			},
+			"Expenses-Other": {
+				"Bad Debts Written Off": {},
+				"Depreciation": {
+					"Dep-AV Equipment": {},
+					"Dep-Bar Equipment": {},
+					"Dep-ICT Equipment": {},
+					"Dep-Electrical Equipment": {},
+					"Dep-Fixtures & Furniture": {},
+					"Dep-Kitchen Equipment": {},
+					"Dep-Lighting Equipment": {},
+					"Dep-Motor Vehicle": {},
+					"Dep-Office Equipment": {},
+					"Dep-Plant & Machinery": {},
+					"Dep-Renovation": {}
+				},
+				"Donations": {},
+				"Round Off": {},
+				"Tax Expenses": {
+					"Tax Expenses": {}
+				}
+			},
+			"Expenses-Staff": {
+				"Bonuses": {
+					"Bonus-Executive": {},
+					"Bonus-Non Executive": {},
+					"Bonus-Performance": {}
+				},
+				"CPF": {},
+				"Directors Fees": {},
+				"FWL": {},
+				"Incentives": {},
+				"Medical Expenses": {},
+				"Salaries": {
+					"Casual Labour": {},
+					"Salary-Executive": {},
+					"Salary-Non Executive-Full Time": {},
+					"Salary-Non Executive-Part Time": {}
+				},
+				"SDF": {},
+				"Security Expenses": {},
+				"Staff Advertising": {},
+				"Staff Commission Paid": {},
+				"Staff Meals": {},
+				"Staff Training": {},
+				"Staff Transport": {},
+				"Staff Uniforms": {},
+				"Staff Welfare": {}
+			},
+			"root_type": "Expense"
+		}
+	}
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 120106a..29dee1e 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -101,19 +101,6 @@
 		frappe.db.set(self, "default_payable_account", frappe.db.get_value("Account",
 			{"company": self.name, "account_type": "Payable"}))
 
-	def add_acc(self, lst):
-		account = frappe.get_doc({
-			"doctype": "Account",
-			"freeze_account": "No",
-			"company": self.name
-		})
-
-		for d in self.fld_dict.keys():
-			account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]])
-		if not account.parent_account:
-			account.flags.ignore_mandatory = True
-		account.insert()
-
 	def set_default_accounts(self):
 		self._set_default_account("default_cash_account", "Cash")
 		self._set_default_account("default_bank_account", "Bank")