Merge pull request #6727 from saurabh6790/hotfix
[enhance] introduce ignore_fields param for _tree and get_query
This commit is contained in:
commit
5ad56ef446
@ -1,3 +1,5 @@
|
||||
frappe.provide("frappe.treeview_settings")
|
||||
|
||||
frappe.treeview_settings["Account"] = {
|
||||
breadcrumbs: "Accounts",
|
||||
title: __("Chart Of Accounts"),
|
||||
@ -33,10 +35,19 @@ frappe.treeview_settings["Account"] = {
|
||||
{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate'),
|
||||
depends_on: 'eval:doc.is_group==1&&doc.account_type=="Tax"'},
|
||||
{fieldtype:'Link', fieldname:'warehouse', label:__('Warehouse'), options:"Warehouse",
|
||||
depends_on: 'eval:(!doc.is_group&&doc.account_type=="Warehouse")'},
|
||||
depends_on: 'eval:(!doc.is_group&&doc.account_type=="Stock")',
|
||||
get_query: function() {
|
||||
return {
|
||||
filters:{
|
||||
"company": frappe.treeview_settings.filters["company"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{fieldtype:'Link', fieldname:'account_currency', label:__('Currency'), options:"Currency",
|
||||
description: __("Optional. Sets company's default currency, if not specified.")}
|
||||
],
|
||||
ignore_fields:["parent_account"],
|
||||
onrender: function(node) {
|
||||
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
||||
if (node.data && node.data.balance!==undefined) {
|
||||
|
@ -23,4 +23,5 @@ frappe.treeview_settings["Cost Center"] = {
|
||||
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
|
||||
description:__('Further cost centers can be made under Groups but entries can be made against non-Groups')}
|
||||
],
|
||||
ignore_fields:["parent_cost_center"]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
frappe.treeview_settings["Customer Group"] = {
|
||||
ignore_fields:["parent_customer_group"]
|
||||
}
|
3
erpnext/setup/doctype/item_group/item_group_tree.js
Normal file
3
erpnext/setup/doctype/item_group/item_group_tree.js
Normal file
@ -0,0 +1,3 @@
|
||||
frappe.treeview_settings["Item Group"] = {
|
||||
ignore_fields:["parent_item_group"]
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
|
||||
frappe.treeview_settings["Sales Person"] = {
|
||||
fields: [
|
||||
{fieldtype:'Data', fieldname: 'sales_person_name',
|
||||
|
3
erpnext/setup/doctype/territory/territory_tree.js
Normal file
3
erpnext/setup/doctype/territory/territory_tree.js
Normal file
@ -0,0 +1,3 @@
|
||||
frappe.treeview_settings["Territory"] = {
|
||||
ignore_fields:["parent_territory"]
|
||||
}
|
@ -16,6 +16,7 @@ frappe.treeview_settings['Warehouse'] = {
|
||||
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
|
||||
description: __("Child nodes can be only created under 'Group' type nodes")}
|
||||
],
|
||||
ignore_fields:["parent_warehouse"],
|
||||
onrender: function(node) {
|
||||
if (node.data && node.data.balance!==undefined) {
|
||||
$('<span class="balance-area pull-right text-muted small">'
|
||||
|
Loading…
x
Reference in New Issue
Block a user