[ux] fixed creation via tree views for Item Group etc

This commit is contained in:
Rushabh Mehta 2015-01-01 15:59:34 +05:30
parent 56ac3fb29d
commit 4c36d7388c
40 changed files with 4466 additions and 4429 deletions

View File

@ -176,8 +176,8 @@
], ],
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 0,
"modified": "2014-08-27 15:12:35.506765", "modified": "2015-01-01 15:36:43.219662",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Account", "name": "Account",

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-02-22 01:27:38.000000", "creation": "2013-02-22 01:27:38",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -24,7 +24,7 @@
"width": "120px" "width": "120px"
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -60,9 +60,10 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:23:00.000000", "modified": "2015-01-01 14:29:58.597428",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "C-Form Invoice Detail", "name": "C-Form Invoice Detail",
"owner": "Administrator" "owner": "Administrator",
"permissions": []
} }

View File

@ -16,7 +16,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -207,7 +207,7 @@
], ],
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"modified": "2014-09-09 05:35:31.969193", "modified": "2015-01-01 14:30:03.415900",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "POS Setting", "name": "POS Setting",

View File

@ -261,7 +261,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -399,7 +399,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:35.712453", "modified": "2015-01-01 14:29:58.851242",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Invoice Item", "name": "Purchase Invoice Item",

View File

@ -734,7 +734,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -747,7 +747,7 @@
"search_index": 0 "search_index": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -1192,7 +1192,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 14:27:52.461964", "modified": "2015-01-01 14:30:04.525035",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice", "name": "Sales Invoice",

View File

@ -298,7 +298,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -439,7 +439,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:36.019576", "modified": "2015-01-01 14:29:59.027192",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice Item", "name": "Sales Invoice Item",

View File

@ -44,10 +44,14 @@ pscript['onload_Accounts Browser'] = function(wrapper){
wrapper.page.add_menu_item(__('New Company'), function() { newdoc('Company'); }, true); wrapper.page.add_menu_item(__('New Company'), function() { newdoc('Company'); }, true);
} }
wrapper.page.set_primary_action(__('Refresh'), function() { wrapper.page.set_secondary_action(__('Refresh'), function() {
wrapper.$company_select.change(); wrapper.$company_select.change();
}); });
wrapper.page.set_primary_action(__('New'), function() {
erpnext.account_chart && erpnext.account_chart.new_account();
});
// company-select // company-select
wrapper.$company_select = wrapper.page.add_select("Company", []) wrapper.$company_select = wrapper.page.add_select("Company", [])
.change(function() { .change(function() {
@ -181,6 +185,13 @@ erpnext.AccountsChart = Class.extend({
new_account: function() { new_account: function() {
var me = this; var me = this;
var node = me.tree.get_selected_node();
if(!(node && node.expandable)) {
frappe.msgprint(__("Select a group node first."));
return;
}
// the dialog // the dialog
var d = new frappe.ui.Dialog({ var d = new frappe.ui.Dialog({
title:__('New Account'), title:__('New Account'),
@ -194,8 +205,7 @@ erpnext.AccountsChart = Class.extend({
'Equity', 'Cost of Goods Sold', 'Fixed Asset', 'Expense Account', 'Equity', 'Cost of Goods Sold', 'Fixed Asset', 'Expense Account',
'Income Account', 'Tax', 'Chargeable'].join('\n'), 'Income Account', 'Tax', 'Chargeable'].join('\n'),
description: __("Optional. This setting will be used to filter in various transactions.") }, description: __("Optional. This setting will be used to filter in various transactions.") },
{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate')}, {fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate')}
{fieldtype:'Button', fieldname:'create_new', label:__('Create New') }
] ]
}) })
@ -224,7 +234,7 @@ erpnext.AccountsChart = Class.extend({
}) })
// create // create
$(fd.create_new.input).click(function() { d.set_primary_action(__("Create New"), function() {
var btn = this; var btn = this;
var v = d.get_values(); var v = d.get_values();
if(!v) return; if(!v) return;

View File

@ -1,22 +1,21 @@
frappe.pages['pos'].onload = function(wrapper) { frappe.pages['pos'].onload = function(wrapper) {
frappe.ui.make_app_page({ var page = frappe.ui.make_app_page({
parent: wrapper, parent: wrapper,
title: __('Start POS'), title: __('Start POS'),
single_column: true single_column: true
}); });
wrapper.body.html('<div class="text-center" style="margin: 40px">\ page.main.html('<div class="text-center" style="padding: 40px">\
<p>' + __("Select type of transaction") + '</p>\ <p>' + __("Select type of transaction") + '</p>\
<p class="select-type" style="margin: auto; max-width: 300px; margin-bottom: 15px;"></p>\ <p class="select-type" style="margin: auto; max-width: 300px; margin-bottom: 15px;"></p>\
<p class="alert alert-warning pos-setting-message hide">' <p class="pos-setting-message hide">'
+ __("Please setup your POS Preferences") + '<br><a class="btn btn-default btn-sm" onclick="newdoc(\'POS Setting\')">'
+ ': <a class="btn btn-default" onclick="newdoc(\'POS Setting\')">' + __("Make new POS Setting") + '</a><br><br></p>\
+ __("Make new POS Setting") + '</a></p>\ <p><button class="btn btn-primary btn-sm">' + __("Start") + '</button></p>\
<p><button class="btn btn-primary">' + __("Start") + '</button></p>\
</div>'); </div>');
var pos_type = frappe.ui.form.make_control({ var pos_type = frappe.ui.form.make_control({
parent: wrapper.body.find(".select-type"), parent: page.main.find(".select-type"),
df: { df: {
fieldtype: "Select", fieldtype: "Select",
options: [ options: [
@ -35,7 +34,7 @@ frappe.pages['pos'].onload = function(wrapper) {
pos_type.refresh(); pos_type.refresh();
wrapper.body.find(".btn-primary").on("click", function() { page.main.find(".btn-primary").on("click", function() {
erpnext.open_as_pos = true; erpnext.open_as_pos = true;
new_doc(pos_type.get_value()); new_doc(pos_type.get_value());
}); });
@ -44,7 +43,7 @@ frappe.pages['pos'].onload = function(wrapper) {
url: "/api/resource/POS Setting", url: "/api/resource/POS Setting",
success: function(data) { success: function(data) {
if(!data.data.length) { if(!data.data.length) {
wrapper.body.find(".pos-setting-message").removeClass('hide'); page.main.find(".pos-setting-message").removeClass('hide');
} }
} }
}) })

View File

@ -354,7 +354,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -455,7 +455,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-11-07 15:09:45.530230", "modified": "2015-01-01 14:29:59.868306",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order Item", "name": "Purchase Order Item",

View File

@ -288,7 +288,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -331,7 +331,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:36.623995", "modified": "2015-01-01 14:29:59.198926",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Quotation Item", "name": "Supplier Quotation Item",

View File

@ -11,3 +11,11 @@ $(document).bind('toolbar_setup', function() {
$('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide") $('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide")
}); });
// doctypes created via tree
frappe.create_routes["Customer Group"] = "Sales Browser/Customer Group";
frappe.create_routes["Territory"] = "Sales Browser/Territory";
frappe.create_routes["Item Group"] = "Sales Browser/Item Group";
frappe.create_routes["Sales Person"] = "Sales Browser/Sales Person";
frappe.create_routes["Account"] = "Accounts Browser/Account";
frappe.create_routes["Cost Center"] = "Accounts Browser/Cost Center";

View File

@ -73,7 +73,7 @@
"width": "50%" "width": "50%"
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -88,7 +88,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -266,7 +266,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-12-24 16:23:11.018042", "modified": "2015-01-01 14:30:00.368262",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Customer", "name": "Customer",

View File

@ -107,7 +107,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -120,7 +120,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Customer Group", "label": "Customer Group",
@ -236,7 +236,7 @@
"icon": "icon-wrench", "icon": "icon-wrench",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 15:33:52.513813", "modified": "2015-01-01 14:30:01.822455",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Installation Note", "name": "Installation Note",

View File

@ -229,7 +229,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Territory", "label": "Territory",
@ -331,7 +331,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-12-01 08:22:23.286314", "modified": "2015-01-01 14:30:02.458843",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Lead", "name": "Lead",

View File

@ -173,7 +173,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -187,7 +187,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -389,7 +389,7 @@
"icon": "icon-info-sign", "icon": "icon-info-sign",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 14:22:53.858170", "modified": "2015-01-01 14:30:03.287608",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Opportunity", "name": "Opportunity",

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-02-22 01:27:51.000000", "creation": "2013-02-22 01:27:51",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -25,7 +25,7 @@
"reqd": 1 "reqd": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -115,9 +115,10 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-02-03 12:40:44.000000", "modified": "2015-01-01 14:29:58.657537",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Opportunity Item", "name": "Opportunity Item",
"owner": "Administrator" "owner": "Administrator",
"permissions": []
} }

View File

@ -583,7 +583,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -598,7 +598,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -800,7 +800,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 1, "max_attachments": 1,
"modified": "2014-12-24 14:24:12.930936", "modified": "2015-01-01 14:30:03.814148",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Quotation", "name": "Quotation",

View File

@ -299,7 +299,7 @@
"report_hide": 1 "report_hide": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -332,7 +332,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:36.871532", "modified": "2015-01-01 14:29:59.329982",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Quotation Item", "name": "Quotation Item",

View File

@ -614,7 +614,7 @@
"width": "50%" "width": "50%"
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -626,7 +626,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -1021,7 +1021,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"issingle": 0, "issingle": 0,
"modified": "2014-12-24 14:25:16.633280", "modified": "2015-01-01 14:30:05.304190",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Sales Order", "name": "Sales Order",

View File

@ -270,7 +270,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -415,7 +415,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:37.173841", "modified": "2015-01-01 14:29:59.458236",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Sales Order Item", "name": "Sales Order Item",

View File

@ -23,7 +23,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -32,7 +32,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -83,7 +83,7 @@
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2014-05-28 18:12:55.898953", "modified": "2015-01-01 14:30:05.798080",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Selling Settings", "name": "Selling Settings",

View File

@ -2,14 +2,14 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
pscript['onload_Sales Browser'] = function(wrapper){ pscript['onload_Sales Browser'] = function(wrapper){
frappe.ui.make_app_page({ var page = frappe.ui.make_app_page({
parent: wrapper, parent: wrapper,
single_column: true, single_column: true,
}) });
frappe.add_breadcrumbs("Selling") frappe.add_breadcrumbs("Selling")
wrapper.page.set_primary_action(__('Refresh'), function() { wrapper.page.set_secondary_action(__('Refresh'), function() {
wrapper.make_tree(); wrapper.make_tree();
}); });
@ -20,7 +20,7 @@ pscript['onload_Sales Browser'] = function(wrapper){
args: {ctype: ctype}, args: {ctype: ctype},
callback: function(r) { callback: function(r) {
var root = r.message[0]["value"]; var root = r.message[0]["value"];
erpnext.sales_chart = new erpnext.SalesChart(ctype, root, erpnext.sales_chart = new erpnext.SalesChart(ctype, root, page,
$(wrapper) $(wrapper)
.find(".layout-main-section") .find(".layout-main-section")
.css({ .css({
@ -46,16 +46,21 @@ pscript['onshow_Sales Browser'] = function(wrapper){
}; };
erpnext.SalesChart = Class.extend({ erpnext.SalesChart = Class.extend({
init: function(ctype, root, parent) { init: function(ctype, root, page, parent) {
$(parent).empty(); $(parent).empty();
var me = this; var me = this;
me.ctype = ctype; me.ctype = ctype;
me.page = page;
me.can_read = frappe.model.can_read(this.ctype); me.can_read = frappe.model.can_read(this.ctype);
me.can_create = frappe.boot.user.can_create.indexOf(this.ctype) !== -1 || me.can_create = frappe.boot.user.can_create.indexOf(this.ctype) !== -1 ||
frappe.boot.user.in_create.indexOf(this.ctype) !== -1; frappe.boot.user.in_create.indexOf(this.ctype) !== -1;
me.can_write = frappe.model.can_write(this.ctype); me.can_write = frappe.model.can_write(this.ctype);
me.can_delete = frappe.model.can_delete(this.ctype); me.can_delete = frappe.model.can_delete(this.ctype);
me.page.set_primary_action(__("New"), function() {
me.new_node();
});
this.tree = new frappe.ui.Tree({ this.tree = new frappe.ui.Tree({
parent: $(parent), parent: $(parent),
label: __(root), label: __(root),
@ -103,6 +108,12 @@ erpnext.SalesChart = Class.extend({
}, },
new_node: function() { new_node: function() {
var me = this; var me = this;
var node = me.tree.get_selected_node();
if(!(node && node.expandable)) {
frappe.msgprint(__("Select a group node first."));
return;
}
var fields = [ var fields = [
{fieldtype:'Data', fieldname: 'name_field', {fieldtype:'Data', fieldname: 'name_field',

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-06-20 12:48:38.000000", "creation": "2013-06-20 12:48:38",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -16,9 +16,10 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:22:53.000000", "modified": "2015-01-01 14:29:58.724652",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Applicable Territory", "name": "Applicable Territory",
"owner": "Administrator" "owner": "Administrator",
"permissions": []
} }

View File

@ -19,7 +19,7 @@
"reqd": 1 "reqd": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "parent_customer_group", "fieldname": "parent_customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
@ -95,7 +95,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "old_parent", "fieldname": "old_parent",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -125,8 +125,8 @@
], ],
"icon": "icon-sitemap", "icon": "icon-sitemap",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 0,
"modified": "2014-12-25 12:48:13.727656", "modified": "2015-01-01 15:35:30.178039",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Customer Group", "name": "Customer Group",
@ -134,6 +134,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -190,6 +191,6 @@
"write": 0 "write": 0
} }
], ],
"read_only": 1, "read_only": 0,
"search_fields": "parent_customer_group" "search_fields": "parent_customer_group"
} }

View File

@ -28,7 +28,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "parent_item_group", "fieldname": "parent_item_group",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
@ -169,7 +169,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "old_parent", "fieldname": "old_parent",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -190,7 +190,7 @@
"in_create": 1, "in_create": 1,
"issingle": 0, "issingle": 0,
"max_attachments": 3, "max_attachments": 3,
"modified": "2014-12-25 12:33:43.359081", "modified": "2015-01-01 14:30:02.349930",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Item Group", "name": "Item Group",

View File

@ -33,7 +33,7 @@
"search_index": 0 "search_index": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -200,7 +200,7 @@
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"modified": "2014-12-25 15:37:44.884917", "modified": "2015-01-01 14:30:05.641746",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Sales Partner", "name": "Sales Partner",

View File

@ -142,8 +142,8 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 0,
"modified": "2014-12-25 15:37:37.695495", "modified": "2015-01-01 15:39:11.451348",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Sales Person", "name": "Sales Person",

View File

@ -4,7 +4,7 @@
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -54,7 +54,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-05-09 02:16:41.436257", "modified": "2015-01-01 14:29:58.758761",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Target Detail", "name": "Target Detail",

View File

@ -20,7 +20,7 @@
"reqd": 1 "reqd": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "parent_territory", "fieldname": "parent_territory",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
@ -91,7 +91,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "old_parent", "fieldname": "old_parent",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -135,8 +135,8 @@
], ],
"icon": "icon-map-marker", "icon": "icon-map-marker",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 0,
"modified": "2014-12-25 15:37:31.563276", "modified": "2015-01-01 15:36:03.787473",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Territory", "name": "Territory",
@ -196,6 +196,6 @@
"role": "Maintenance User" "role": "Maintenance User"
} }
], ],
"read_only": 1, "read_only": 0,
"search_fields": "parent_territory,territory_manager" "search_fields": "parent_territory,territory_manager"
} }

View File

@ -1,12 +1,12 @@
{ {
"creation": "2013-02-22 01:28:09.000000", "creation": "2013-02-22 01:28:09",
"description": "Cross Listing of Item in multiple groups", "description": "Cross Listing of Item in multiple groups",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Other", "document_type": "Other",
"fields": [ "fields": [
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
@ -18,9 +18,10 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-02-28 13:00:07.000000", "modified": "2015-01-01 14:29:58.803777",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Website Item Group", "name": "Website Item Group",
"owner": "Administrator" "owner": "Administrator",
"permissions": []
} }

View File

@ -676,7 +676,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -690,7 +690,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -1013,7 +1013,7 @@
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 14:26:18.627591", "modified": "2015-01-01 14:30:01.408528",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Delivery Note", "name": "Delivery Note",

View File

@ -272,7 +272,7 @@
"read_only": 0 "read_only": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -438,7 +438,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-10-08 11:11:59.411329", "modified": "2015-01-01 14:29:59.711539",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Delivery Note Item", "name": "Delivery Note Item",

View File

@ -66,7 +66,7 @@
"search_index": 1 "search_index": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -876,7 +876,7 @@
"icon": "icon-tag", "icon": "icon-tag",
"idx": 1, "idx": 1,
"max_attachments": 1, "max_attachments": 1,
"modified": "2014-12-26 11:17:46.327235", "modified": "2015-01-01 14:30:01.954176",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item", "name": "Item",

View File

@ -127,7 +127,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -235,7 +235,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-09-09 05:35:37.746067", "modified": "2015-01-01 14:29:59.597199",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Material Request Item", "name": "Material Request Item",

View File

@ -457,7 +457,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
@ -559,7 +559,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-11-07 15:54:08.266918", "modified": "2015-01-01 14:30:00.032715",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Purchase Receipt Item", "name": "Purchase Receipt Item",

View File

@ -1,5 +1,5 @@
{ {
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:serial_no", "autoname": "field:serial_no",
"creation": "2013-05-16 10:59:15", "creation": "2013-05-16 10:59:15",
@ -109,7 +109,7 @@
"width": "300px" "width": "300px"
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 0, "in_filter": 0,
@ -417,7 +417,7 @@
"icon": "icon-barcode", "icon": "icon-barcode",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"modified": "2014-06-26 12:33:49.911829", "modified": "2015-01-01 14:30:05.865206",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Serial No", "name": "Serial No",

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-06-24 16:37:54.000000", "creation": "2013-06-24 16:37:54",
"description": "Settings", "description": "Settings",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -8,14 +8,16 @@
"default": "Item Code", "default": "Item Code",
"fieldname": "item_naming_by", "fieldname": "item_naming_by",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Item Naming By", "label": "Item Naming By",
"options": "Item Code\nNaming Series", "options": "Item Code\nNaming Series",
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", "description": "",
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Default Item Group", "label": "Default Item Group",
"options": "Item Group", "options": "Item Group",
"permlevel": 0 "permlevel": 0
@ -23,6 +25,7 @@
{ {
"fieldname": "stock_uom", "fieldname": "stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Default Stock UOM", "label": "Default Stock UOM",
"options": "UOM", "options": "UOM",
"permlevel": 0 "permlevel": 0
@ -35,6 +38,7 @@
{ {
"fieldname": "allow_negative_stock", "fieldname": "allow_negative_stock",
"fieldtype": "Check", "fieldtype": "Check",
"in_list_view": 1,
"label": "Allow Negative Stock", "label": "Allow Negative Stock",
"permlevel": 0 "permlevel": 0
}, },
@ -99,7 +103,7 @@
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2014-02-19 19:02:23.000000", "modified": "2015-01-01 14:30:06.164157",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Settings", "name": "Stock Settings",

View File

@ -244,7 +244,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Customer Group", "label": "Customer Group",
@ -255,7 +255,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -396,7 +396,7 @@
"icon": "icon-bug", "icon": "icon-bug",
"idx": 1, "idx": 1,
"is_submittable": 0, "is_submittable": 0,
"modified": "2014-07-07 02:47:56.491906", "modified": "2015-01-01 14:30:00.857711",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Support", "module": "Support",
"name": "Customer Issue", "name": "Customer Issue",

View File

@ -180,7 +180,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
@ -194,7 +194,7 @@
}, },
{ {
"depends_on": "customer", "depends_on": "customer",
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Customer Group", "label": "Customer Group",
@ -228,7 +228,7 @@
"icon": "icon-calendar", "icon": "icon-calendar",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 15:51:42.595081", "modified": "2015-01-01 14:30:02.768146",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Support", "module": "Support",
"name": "Maintenance Schedule", "name": "Maintenance Schedule",

View File

@ -258,7 +258,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", "description": "",
"fieldname": "territory", "fieldname": "territory",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Territory", "label": "Territory",
@ -267,7 +267,7 @@
"print_hide": 1 "print_hide": 1
}, },
{ {
"description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", "description": "",
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Customer Group", "label": "Customer Group",
@ -279,7 +279,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-12-24 16:20:49.640483", "modified": "2015-01-01 14:30:02.998219",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Support", "module": "Support",
"name": "Maintenance Visit", "name": "Maintenance Visit",