From fb4b8d926f64ce3b7f439cd05ec4cfc55319b17f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 12 Mar 2017 16:44:25 +0530 Subject: [PATCH] Company based on exising company fix --- .../account/chart_of_accounts/chart_of_accounts.py | 3 +-- .../verified/ae_uae_chart_template_standard.json | 5 +---- .../chart_of_accounts/verified/sg_default_coa.json | 5 +---- erpnext/setup/doctype/company/company.json | 11 ++++++----- erpnext/setup/doctype/company/test_company.py | 2 +- 5 files changed, 10 insertions(+), 16 deletions(-) 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 ac6240a5de..c7d1291521 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 @@ -117,7 +117,7 @@ def get_charts_for_country(country): def get_account_tree_from_existing_company(existing_company): all_accounts = frappe.get_all('Account', - filters={'company': existing_company}, + filters={'company': existing_company, "warehouse": ""}, fields = ["name", "account_name", "parent_account", "account_type", "is_group", "root_type", "tax_rate"], order_by="lft, rgt") @@ -126,7 +126,6 @@ def get_account_tree_from_existing_company(existing_company): # fill in tree starting with root accounts (those with no parent) build_account_tree(account_tree, None, all_accounts) - return account_tree def build_account_tree(tree, parent, all_accounts): 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 9a9342305c..9d610dce3b 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 @@ -88,10 +88,7 @@ "Items Delivered to Customs on temprary Base": {} }, "Stock in Hand": { - "All Warehouses": { - "account_type": "Stock", - "is_group": 1 - }, + "is_group": 1, "account_type": "Stock" } }, 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 index 58a89b53a5..976150f128 100644 --- 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 @@ -40,10 +40,7 @@ "Rental Deposits": {} }, "Stock Assets": { - "All Warehouses": { - "account_type": "Stock", - "is_group": 1 - }, + "is_group": 1, "account_type": "Stock" }, "Tax Assets": { diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index f52d71edb9..7497a81e34 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, "autoname": "field:company_name", @@ -407,7 +408,7 @@ "label": "Create Chart Of Accounts Based On", "length": 0, "no_copy": 0, - "options": "Standard Template\nExisting Company", + "options": "\nStandard Template\nExisting Company", "permlevel": 0, "precision": "", "print_hide": 0, @@ -415,7 +416,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -1680,19 +1681,19 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-building", "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-03-02 15:24:52.908559", + "modified": "2017-03-12 15:50:23.099622", "modified_by": "Administrator", "module": "Setup", "name": "Company", @@ -1846,4 +1847,4 @@ "sort_order": "ASC", "track_changes": 0, "track_seen": 0 -} +} \ No newline at end of file diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index d2e7d23d92..4b864c4ca1 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -28,7 +28,7 @@ class TestCompany(unittest.TestCase): "root_type": "Asset", "parent_account": "Accounts Receivable - CFEC", }, - "_Test Cash - CFEC": { + "Cash - CFEC": { "account_type": "Cash", "is_group": 0, "root_type": "Asset",