From 9342f650e0a8708e78234ee215509b38184552b0 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 23 Nov 2016 13:09:36 +0530 Subject: [PATCH 1/2] [fix] remove root type selection while created new node and hooks call to initialize payment gateway --- erpnext/accounts/doctype/account/account_tree.js | 3 ++- erpnext/hooks.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index e63c797184..b804fbddb9 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -27,7 +27,8 @@ frappe.treeview_settings["Account"] = { {fieldtype:'Check', fieldname:'is_group', label:__('Is Group'), description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')}, {fieldtype:'Select', fieldname:'root_type', label:__('Root Type'), - options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n')}, + options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'), + depends_on: 'eval:doc.is_group'}, {fieldtype:'Select', fieldname:'account_type', label:__('Account Type'), options: ['', 'Bank', 'Cash', 'Stock', 'Tax', 'Chargeable', 'Fixed Asset'].join('\n'), description: __("Optional. This setting will be used to filter in various transactions.") diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 90c7f51824..4a984704a1 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -212,3 +212,5 @@ bot_parsers = [ ] get_site_info = 'erpnext.utilities.get_site_info' + +payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_and_account" From cf895c220c27c548a39e354c991b3608b3323100 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Nov 2016 14:44:07 +0530 Subject: [PATCH 2/2] Update account_tree.js --- erpnext/accounts/doctype/account/account_tree.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index b804fbddb9..4cf9a678f8 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -28,7 +28,7 @@ frappe.treeview_settings["Account"] = { description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')}, {fieldtype:'Select', fieldname:'root_type', label:__('Root Type'), options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'), - depends_on: 'eval:doc.is_group'}, + depends_on: 'eval:doc.is_group && !doc.parent_account'}, {fieldtype:'Select', fieldname:'account_type', label:__('Account Type'), options: ['', 'Bank', 'Cash', 'Stock', 'Tax', 'Chargeable', 'Fixed Asset'].join('\n'), description: __("Optional. This setting will be used to filter in various transactions.") @@ -80,4 +80,4 @@ frappe.treeview_settings["Account"] = { } ], extend_toolbar: true -} \ No newline at end of file +}