Append to Tree View

I am trying to append information to the item names in a Tree view without success. For example, n the Chart of Accounts Tree View, there is the account name appended to the company abbreviation with an ‘-’ as shown:


I have combed through both the tree.js file and the file trying to figure out where those fields are appended without success. Could someone point me in the right location where this happens? My end goal is to modify the BOM tree view to include the item name and cost in the same manner.

1 Like

I figured it out somewhat. If someone needs a more functional v10 BOM tree view, try replacing the get_label function in the bom_tree.js file with the code below. It will add the item name, quantity, unit of measure and item cost to the BOM Tree.

get_label: function(node) {
	 if(! {
		return ||;
	else if( {
		return + "  " + + " $" +;
	else {
		return + "  " + + ", QTY: " + + " " + + ", $" +;

You also have to change the query in the file with this:

def get_children(doctype, parent=None, is_root=False, **filters):

if frappe.form_dict.parent:
	return frappe.db.sql("""select
		bom_item.bom_no as value,
		bom_item.item_name as title,
		if(ifnull(bom_item.bom_no, "")!="", 1, 0) as expandable,
		from `tabBOM Item` bom_item, tabItem item
		where bom_item.parent=%s
		and bom_item.item_code =
		order by bom_item.idx
		""", frappe.form_dict.parent, as_dict=True) """

hi everyone i am trying to customize the item group tree to show items that are related to the particular group as a list within their parent group.
For e.g:
-----item 1
-----item 2
-----item 3
-----item 4
-----item 5

Any ideas of how i would go about this to accomplish this task.

have you achieved it?