diff --git a/erpnext/accounts/report/customer_account_head/__init__.py b/erpnext/accounts/report/customer_account_head/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/accounts/report/customer_account_head/customer_account_head.json b/erpnext/accounts/report/customer_account_head/customer_account_head.json deleted file mode 100644 index 972c3aaec03..00000000000 --- a/erpnext/accounts/report/customer_account_head/customer_account_head.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "apply_user_permissions": 1, - "creation": "2013-06-03 16:17:34", - "docstatus": 0, - "doctype": "Report", - "idx": 1, - "is_standard": "Yes", - "modified": "2014-06-03 07:18:16.993419", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Customer Account Head", - "owner": "Administrator", - "ref_doctype": "Account", - "report_name": "Customer Account Head", - "report_type": "Script Report" -} \ No newline at end of file diff --git a/erpnext/accounts/report/customer_account_head/customer_account_head.py b/erpnext/accounts/report/customer_account_head/customer_account_head.py deleted file mode 100644 index 291d6aa1bd7..00000000000 --- a/erpnext/accounts/report/customer_account_head/customer_account_head.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - -from __future__ import unicode_literals -import frappe - -def execute(filters=None): - account_map = get_account_map() - columns = get_columns(account_map) - data = [] - customers = frappe.db.sql("select name from tabCustomer where docstatus < 2") - for cust in customers: - row = [cust[0]] - for company in sorted(account_map): - row.append(account_map[company].get(cust[0], '')) - data.append(row) - - return columns, data - -def get_account_map(): - accounts = frappe.db.sql("""select name, company, master_name - from `tabAccount` where master_type = 'Customer' - and ifnull(master_name, '') != '' and docstatus < 2""", as_dict=1) - - account_map = {} - for acc in accounts: - account_map.setdefault(acc.company, {}).setdefault(acc.master_name, {}) - account_map[acc.company][acc.master_name] = acc.name - - return account_map - -def get_columns(account_map): - columns = ["Customer:Link/Customer:120"] + \ - [(company + ":Link/Account:120") for company in sorted(account_map)] - - return columns \ No newline at end of file diff --git a/erpnext/accounts/report/supplier_account_head/__init__.py b/erpnext/accounts/report/supplier_account_head/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/accounts/report/supplier_account_head/supplier_account_head.json b/erpnext/accounts/report/supplier_account_head/supplier_account_head.json deleted file mode 100644 index 72730f0e1a7..00000000000 --- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "apply_user_permissions": 1, - "creation": "2013-06-04 12:56:17", - "docstatus": 0, - "doctype": "Report", - "idx": 1, - "is_standard": "Yes", - "modified": "2014-06-03 07:18:17.353489", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Supplier Account Head", - "owner": "Administrator", - "ref_doctype": "Account", - "report_name": "Supplier Account Head", - "report_type": "Script Report" -} \ No newline at end of file diff --git a/erpnext/accounts/report/supplier_account_head/supplier_account_head.py b/erpnext/accounts/report/supplier_account_head/supplier_account_head.py deleted file mode 100644 index 11e1a0dc98d..00000000000 --- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - -from __future__ import unicode_literals -import frappe - -def execute(filters=None): - account_map = get_account_map() - columns = get_columns(account_map) - data = [] - suppliers = frappe.db.sql("select name from tabSupplier where docstatus < 2") - for supplier in suppliers: - row = [supplier[0]] - for company in sorted(account_map): - row.append(account_map[company].get(supplier[0], '')) - data.append(row) - - return columns, data - -def get_account_map(): - accounts = frappe.db.sql("""select name, company, master_name - from `tabAccount` where master_type = 'Supplier' - and ifnull(master_name, '') != '' and docstatus < 2""", as_dict=1) - - account_map = {} - for acc in accounts: - account_map.setdefault(acc.company, {}).setdefault(acc.master_name, {}) - account_map[acc.company][acc.master_name] = acc.name - - return account_map - -def get_columns(account_map): - columns = ["Supplier:Link/Supplier:120"] + \ - [(company + ":Link/Account:120") for company in sorted(account_map)] - - return columns \ No newline at end of file diff --git a/erpnext/patches/v4_2/party_model.py b/erpnext/patches/v4_2/party_model.py index b1ca87cbcbd..e1fa982b1b2 100644 --- a/erpnext/patches/v4_2/party_model.py +++ b/erpnext/patches/v4_2/party_model.py @@ -10,6 +10,7 @@ def execute(): receivable_payable_accounts = create_receivable_payable_account() set_party_in_jv_and_gl_entry(receivable_payable_accounts) delete_individual_party_account(receivable_payable_accounts) + remove_customer_supplier_account_report() except: print frappe.get_traceback() pass @@ -87,3 +88,7 @@ def set_party_in_jv_and_gl_entry(receivable_payable_accounts): def delete_individual_party_account(): frappe.db.sql("""delete from `tabAccount` where ifnull(master_type, '') in ('Customer', 'Supplier') and ifnull(master_name, '') != ''""") + +def remove_customer_supplier_account_report(): + for d in ["Customer Account Head", "Supplier Account Head"]: + frappe.delete_doc("Report", d)