From 281e92fb6e76e52324ba6db3d22e9bbb3ab65f26 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 4 Aug 2026 15:34:59 +0530 Subject: [PATCH] fix(manufacturing): reach the whole configurator from tree toolbar actions The toolbar handlers were copied onto view.events as unbound functions, so `this` inside them was that object literal rather than the BOMConfigurator. They worked only because the literal also carried `frm`, and broke as soon as a handler called a method the literal did not list: get_item_code, added when the tree started keying nodes on the row name, threw "this.get_item_code is not a function" and killed Add Raw Material, Add Sub Assembly and Convert to Sub Assembly. Assign the instance instead of a hand-maintained whitelist. Every method is reachable, `this.frm` keeps working, and no future method can be forgotten. Fixes #57773 (cherry picked from commit 097ce0f3487c17a927cc66526c71a63c4dae9ddb) --- .../js/bom_configurator/bom_configurator.bundle.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/erpnext/public/js/bom_configurator/bom_configurator.bundle.js b/erpnext/public/js/bom_configurator/bom_configurator.bundle.js index 297f6be4ba3..fd419eb8c1f 100644 --- a/erpnext/public/js/bom_configurator/bom_configurator.bundle.js +++ b/erpnext/public/js/bom_configurator/bom_configurator.bundle.js @@ -32,18 +32,7 @@ class BOMConfigurator { } bind_events() { - frappe.views.trees["BOM Configurator"].events = { - frm: this.frm, - add_item: this.add_item, - add_sub_assembly: this.add_sub_assembly, - set_query_for_workstation: this.set_query_for_workstation, - get_sub_assembly_modal_fields: this.get_sub_assembly_modal_fields, - convert_to_sub_assembly: this.convert_to_sub_assembly, - delete_node: this.delete_node, - edit_bom: this.edit_bom, - load_tree: this.load_tree, - set_default_qty: this.set_default_qty, - }; + frappe.views.trees["BOM Configurator"].events = this; } tree_options() {