[fix] BOM tree as default view
diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js
index b24a17d..ca2d5f0 100644
--- a/erpnext/accounts/doctype/account/account_tree.js
+++ b/erpnext/accounts/doctype/account/account_tree.js
@@ -15,8 +15,8 @@
menu_items:[
{
label: __('New Company'),
- action: function() { newdoc('Company'); },
- condition: 'frappe.boot.user.can_create.indexOf("Company") === -1'
+ action: function() { frappe.new_doc("Company", true) },
+ condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
}
],
fields: [
diff --git a/erpnext/accounts/doctype/cost_center/cost_center_tree.js b/erpnext/accounts/doctype/cost_center/cost_center_tree.js
index ac82f23..d8d45c5 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center_tree.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center_tree.js
@@ -14,8 +14,8 @@
menu_items:[
{
label: __('New Company'),
- action: function() { newdoc('Company'); },
- condition: 'frappe.boot.user.can_create.indexOf("Company") === -1'
+ action: function() { frappe.new_doc("Company", true) },
+ condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
}
],
fields:[
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index d20e20b..5d43e70 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -33,7 +33,7 @@
on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
remember_selected = ['Company', 'Cost Center', 'Project']
-treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory']
+treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', "BOM"]
# website
update_website_context = "erpnext.shopping_cart.utils.update_website_context"
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index de8ac94..832402e 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -24,6 +24,9 @@
frm.events.update_cost(frm);
});
frm.add_custom_button(__("Browse BOM"), function() {
+ frappe.route_options = {
+ "bom": frm.doc.name
+ };
frappe.set_route("Tree", "BOM");
});
}
diff --git a/erpnext/manufacturing/doctype/bom/bom_tree.js b/erpnext/manufacturing/doctype/bom/bom_tree.js
index 0404360..f6a205f 100644
--- a/erpnext/manufacturing/doctype/bom/bom_tree.js
+++ b/erpnext/manufacturing/doctype/bom/bom_tree.js
@@ -32,4 +32,13 @@
}
}
],
+ menu_items: [
+ {
+ label: __("New BOM"),
+ action: function() {
+ frappe.new_doc("BOM", true)
+ },
+ condition: 'frappe.boot.user.can_create.indexOf("BOM") !== -1'
+ }
+ ]
}
\ No newline at end of file