[fix] BOM tree as default view

This commit is contained in:
Saurabh 2016-06-30 13:33:49 +05:30
parent cfb81205b3
commit 621247807a
5 changed files with 17 additions and 5 deletions

View File

@ -15,8 +15,8 @@ frappe.treeview_settings["Account"] = {
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: [

View File

@ -14,8 +14,8 @@ frappe.treeview_settings["Cost Center"] = {
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:[

View File

@ -33,7 +33,7 @@ on_session_creation = "erpnext.shopping_cart.utils.set_cart_count"
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"

View File

@ -24,6 +24,9 @@ frappe.ui.form.on("BOM", {
frm.events.update_cost(frm);
});
frm.add_custom_button(__("Browse BOM"), function() {
frappe.route_options = {
"bom": frm.doc.name
};
frappe.set_route("Tree", "BOM");
});
}

View File

@ -32,4 +32,13 @@ frappe.treeview_settings["BOM"] = {
}
}
],
menu_items: [
{
label: __("New BOM"),
action: function() {
frappe.new_doc("BOM", true)
},
condition: 'frappe.boot.user.can_create.indexOf("BOM") !== -1'
}
]
}