From 155c96b410366966b4b863c5a4b9ad29ae6ff0b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 21 Mar 2014 12:15:13 +0530 Subject: [PATCH] patch to delete mis control and financial statements and set bank/cash account --- erpnext/config/accounts.py | 5 ----- erpnext/patches.txt | 2 ++ erpnext/patches/4_0/countrywise_coa.py | 9 +++++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index 2a47c2ab4f3..6adb9aeeb4e 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -161,11 +161,6 @@ data = [ "label": _("Trial Balance"), "icon": "icon-table" }, - { - "type": "page", - "name":"Financial Statements", - "icon": "icon-table" - }, { "type": "report", "name": "Accounts Receivable", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index c1f43e38a79..8c20452b856 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -30,3 +30,5 @@ erpnext.patches.4_0.split_email_settings erpnext.patches.4_0.fix_employee_user_id erpnext.patches.4_0.import_country_codes execute:patches.4_0.countrywise_coa +execute:frappe.delete_doc("DocType", "MIS Control") +execute:frappe.delete_doc("Page", "Financial Statements") diff --git a/erpnext/patches/4_0/countrywise_coa.py b/erpnext/patches/4_0/countrywise_coa.py index 6ee898707b0..242585652f9 100644 --- a/erpnext/patches/4_0/countrywise_coa.py +++ b/erpnext/patches/4_0/countrywise_coa.py @@ -8,8 +8,13 @@ def execute(): frappe.reload_doc("setup", 'doctype', "company") frappe.reload_doc("accounts", 'doctype', "account") - frappe.db.sql("""update tabAccount set account_type='Fixed Asset' - where account_type='Fixed Asset Account'""") + frappe.db.sql("""update tabAccount set account_type='Cash' + where account_type='Bank or Cash' and account_name in ('Cash', 'Cash In Hand')""") + + ac_types = {"Fixed Asset Account": "Fixed Asset", "Bank or Cash": "Bank"} + for old, new in ac_types.items: + frappe.db.sql("""update tabAccount set account_type=%s + where account_type=%s""", (new, old)) frappe.db.sql("""update `tabAccount` set report_type = if(is_pl_account=='Yes', 'Profit and Loss', 'Balance Sheet')""")