From 502af4dd67da3a70db63e5f3c840c82f86cfe091 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Thu, 1 Mar 2018 10:44:47 +0530 Subject: [PATCH] display image fnd description for root BOM also (#13099) --- erpnext/manufacturing/doctype/bom/bom_tree.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom_tree.js b/erpnext/manufacturing/doctype/bom/bom_tree.js index 4ec9bef998..185b9ed4bc 100644 --- a/erpnext/manufacturing/doctype/bom/bom_tree.js +++ b/erpnext/manufacturing/doctype/bom/bom_tree.js @@ -60,5 +60,14 @@ frappe.treeview_settings["BOM"] = { condition: 'frappe.boot.user.can_create.indexOf("BOM") !== -1' } ], + onrender: function(node) { + if(node.is_root && node.data.value!="BOM") { + frappe.model.with_doc("BOM", node.data.value, function() { + var bom = frappe.model.get_doc("BOM", node.data.value); + node.data.image = bom.image || ""; + node.data.description = bom.description || ""; + }); + } + }, view_template: 'bom_item_preview' } \ No newline at end of file