Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2012-12-06 13:14:43 +05:30
commit ec61492c40
12 changed files with 1091 additions and 1290 deletions

View File

@ -179,16 +179,16 @@ class DocType:
sql("delete from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'Yes'", self.doc.name) sql("delete from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'Yes'", self.doc.name)
# on rename # on rename
def on_rename(self,newdn,olddn): def on_rename(self, new, old):
company_abbr = sql("select tc.abbr from `tabAccount` ta, `tabCompany` tc where ta.company = tc.name and ta.name=%s", olddn)[0][0] company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
parts = new.split(" - ")
parts = newdn.split(" - ")
if parts[-1].lower() != company_abbr.lower(): if parts[-1].lower() != company_abbr.lower():
parts.append(company_abbr) parts.append(company_abbr)
# rename account name
account_name = " - ".join(parts[:-1]) account_name = " - ".join(parts[:-1])
sql("update `tabAccount` set account_name = '%s' where name = '%s'" % \ sql("update `tabAccount` set account_name = '%s' where name = '%s'" % \
(account_name,olddn)) (account_name, old))
return " - ".join(parts) return " - ".join(parts)

View File

@ -90,3 +90,17 @@ class DocType(DocTypeNestedSet):
self.validate_mandatory() self.validate_mandatory()
self.validate_budget_details() self.validate_budget_details()
def on_rename(self, new, old):
company_abbr = webnotes.conn.get_value("Company", self.doc.company_name, "abbr")
parts = new.split(" - ")
if parts[-1].lower() != company_abbr.lower():
parts.append(company_abbr)
# rename account name
cost_center_name = " - ".join(parts[:-1])
webnotes.conn.sql("update `tabCost Center` set cost_center_name = %s where name = %s", \
(cost_center_name, old))
return " - ".join(parts)

View File

@ -1,319 +1,262 @@
# DocType, Cost Center
[ [
{
# These values are common in all dictionaries "owner": "Administrator",
{ "docstatus": 0,
'creation': '2012-07-03 13:30:47', "creation": "2012-07-12 23:29:41",
'docstatus': 0, "modified_by": "Administrator",
'modified': '2012-07-11 14:41:39', "modified": "2012-12-06 12:12:46"
'modified_by': u'Administrator', },
'owner': u'Administrator' {
}, "in_create": 1,
"search_fields": "name,parent_cost_center",
# These values are common for all DocType "module": "Accounts",
{ "document_type": "Master",
'_last_update': u'1317365120', "description": "Track separate Income and Expense for product verticals or divisions.",
'allow_copy': 1, "autoname": "field:cost_center_name",
'allow_trash': 1, "name": "__common__",
'autoname': u'field:cost_center_name', "default_print_format": "Standard",
'colour': u'White:FFF', "allow_rename": 1,
'default_print_format': u'Standard', "doctype": "DocType",
'description': u'**Chart of Accounts** is mainly for reporting information for governmental purposes and less for how business actually performs. \n\nMost businesses have multiple activities like different product lines, market segments, areas of business that share some common overheads but should ideally have their own structure to report whether they are profitable or not. For this purpose, there is an alternate structure, called the **Cost Centers**.\n\nA tree of **Cost Centers** to cab be designed to reflect the different units of an organization. Each Income / Expense entry is also tagged against a **Cost Center** and hence you can get Profit and Loss against a **Cost Center** too.\n\n### Budgeting\n\n**Cost Centers** can be used for budgeting purposes too. A budget can be set against each **Account** and the system will either stop, warn or ignore the budget based on the settings in the **Company** master.\n\nBudgets can also be distributed seasonally using **Budget Distribution**.', "allow_copy": 1
'doctype': 'DocType', },
'document_type': u'Master', {
'in_create': 1, "name": "__common__",
'module': u'Accounts', "parent": "Cost Center",
'name': '__common__', "doctype": "DocField",
'search_fields': u'name,parent_cost_center', "parenttype": "DocType",
'section_style': u'Simple', "parentfield": "fields"
'server_code_error': u' ', },
'show_in_menu': 0, {
'version': 1 "name": "__common__",
}, "parent": "Cost Center",
"read": 1,
# These values are common for all DocField "doctype": "DocPerm",
{ "parenttype": "DocType",
'doctype': u'DocField', "parentfield": "permissions"
'name': '__common__', },
'parent': u'Cost Center', {
'parentfield': u'fields', "name": "Cost Center",
'parenttype': u'DocType' "doctype": "DocType"
}, },
{
# These values are common for all DocPerm "doctype": "DocField",
{ "label": "Cost Center Details",
'doctype': u'DocPerm', "fieldname": "sb0",
'name': '__common__', "fieldtype": "Section Break",
'parent': u'Cost Center', "permlevel": 0
'parentfield': u'permissions', },
'parenttype': u'DocType', {
'read': 1 "oldfieldtype": "Small Text",
}, "doctype": "DocField",
"label": "Trash Reason",
# DocType, Cost Center "oldfieldname": "trash_reason",
{ "fieldname": "trash_reason",
'doctype': 'DocType', "fieldtype": "Small Text",
'name': u'Cost Center' "permlevel": 1
}, },
{
# DocPerm "no_copy": 1,
{ "oldfieldtype": "Data",
'amend': 0, "doctype": "DocField",
'cancel': 0, "label": "Cost Center Name",
'create': 0, "oldfieldname": "cost_center_name",
'doctype': u'DocPerm', "fieldname": "cost_center_name",
'permlevel': 1, "fieldtype": "Data",
'role': u'Accounts Manager', "search_index": 0,
'submit': 0, "reqd": 1,
'write': 0 "permlevel": 0,
}, "in_filter": 0
},
# DocPerm {
{ "oldfieldtype": "Link",
'amend': 0, "colour": "White:FFF",
'cancel': 1, "doctype": "DocField",
'create': 1, "label": "Parent Cost Center",
'doctype': u'DocPerm', "oldfieldname": "parent_cost_center",
'permlevel': 0, "trigger": "Client",
'role': u'Accounts Manager', "fieldname": "parent_cost_center",
'submit': 0, "fieldtype": "Link",
'write': 1 "reqd": 1,
}, "options": "Cost Center",
"permlevel": 0
# DocPerm },
{ {
'amend': 0, "oldfieldtype": "Link",
'cancel': 0, "colour": "White:FFF",
'create': 0, "doctype": "DocField",
'doctype': u'DocPerm', "label": "Company",
'permlevel': 1, "oldfieldname": "company_name",
'role': u'Accounts User', "trigger": "Client",
'submit': 0, "fieldname": "company_name",
'write': 0 "fieldtype": "Link",
}, "reqd": 1,
"options": "Company",
# DocPerm "permlevel": 0
{ },
'amend': 0, {
'cancel': 0, "oldfieldtype": "Data",
'create': 0, "colour": "White:FFF",
'doctype': u'DocPerm', "doctype": "DocField",
'permlevel': 0, "label": "Company Abbr",
'role': u'Accounts User', "oldfieldname": "company_abbr",
'submit': 0, "fieldname": "company_abbr",
'write': 0 "fieldtype": "Data",
}, "hidden": 1,
"permlevel": 1
# DocPerm },
{ {
'cancel': 1, "doctype": "DocField",
'create': 1, "width": "50%",
'doctype': u'DocPerm', "fieldname": "cb0",
'permlevel': 0, "fieldtype": "Column Break",
'role': u'System Manager', "permlevel": 0
'write': 1 },
}, {
"print_hide": 1,
# DocPerm "no_copy": 1,
{ "oldfieldtype": "Select",
'doctype': u'DocPerm', "colour": "White:FFF",
'permlevel': 1, "doctype": "DocField",
'role': u'All' "label": "Group or Ledger",
}, "oldfieldname": "group_or_ledger",
"permlevel": 0,
# DocField "trigger": "Client",
{ "fieldname": "group_or_ledger",
'doctype': u'DocField', "fieldtype": "Select",
'fieldname': u'sb0', "reqd": 1,
'fieldtype': u'Section Break', "hidden": 0,
'label': u'Cost Center Details', "options": "\nGroup\nLedger",
'permlevel': 0 "report_hide": 1
}, },
{
# DocField "description": "Define Budget for this Cost Center. To set budget action, see <a href=\"#!List/Company\">Company Master</a>",
{ "colour": "White:FFF",
'doctype': u'DocField', "doctype": "DocField",
'fieldname': u'trash_reason', "label": "Budget",
'fieldtype': u'Small Text', "fieldname": "sb1",
'label': u'Trash Reason', "fieldtype": "Section Break",
'oldfieldname': u'trash_reason', "permlevel": 0
'oldfieldtype': u'Small Text', },
'permlevel': 1 {
}, "description": "Select Budget Distribution, if you want to track based on seasonality.",
"oldfieldtype": "Link",
# DocField "colour": "White:FFF",
{ "doctype": "DocField",
'doctype': u'DocField', "label": "Distribution Id",
'fieldname': u'cost_center_name', "oldfieldname": "distribution_id",
'fieldtype': u'Data', "options": "Budget Distribution",
'in_filter': 0, "fieldname": "distribution_id",
'label': u'Cost Center Name', "fieldtype": "Link",
'no_copy': 1, "permlevel": 0
'oldfieldname': u'cost_center_name', },
'oldfieldtype': u'Data', {
'permlevel': 0, "description": "Add rows to set annual budgets on Accounts.",
'reqd': 1, "oldfieldtype": "Table",
'search_index': 0 "colour": "White:FFF",
}, "doctype": "DocField",
"label": "Budget Details",
# DocField "oldfieldname": "budget_details",
{ "options": "Budget Detail",
'colour': u'White:FFF', "fieldname": "budget_details",
'doctype': u'DocField', "fieldtype": "Table",
'fieldname': u'parent_cost_center', "permlevel": 0
'fieldtype': u'Link', },
'label': u'Parent Cost Center', {
'oldfieldname': u'parent_cost_center', "print_hide": 1,
'oldfieldtype': u'Link', "no_copy": 1,
'options': u'Cost Center', "oldfieldtype": "Int",
'permlevel': 0, "doctype": "DocField",
'reqd': 1, "label": "lft",
'trigger': u'Client' "oldfieldname": "lft",
}, "fieldname": "lft",
"fieldtype": "Int",
# DocField "search_index": 1,
{ "hidden": 1,
'colour': u'White:FFF', "permlevel": 0,
'doctype': u'DocField', "report_hide": 1,
'fieldname': u'company_name', "in_filter": 1
'fieldtype': u'Link', },
'label': u'Company', {
'oldfieldname': u'company_name', "print_hide": 1,
'oldfieldtype': u'Link', "no_copy": 1,
'options': u'Company', "oldfieldtype": "Int",
'permlevel': 0, "doctype": "DocField",
'reqd': 1, "label": "rgt",
'trigger': u'Client' "oldfieldname": "rgt",
}, "fieldname": "rgt",
"fieldtype": "Int",
# DocField "search_index": 1,
{ "reqd": 0,
'colour': u'White:FFF', "hidden": 1,
'doctype': u'DocField', "permlevel": 0,
'fieldname': u'company_abbr', "report_hide": 1,
'fieldtype': u'Data', "in_filter": 1
'hidden': 1, },
'label': u'Company Abbr', {
'oldfieldname': u'company_abbr', "print_hide": 1,
'oldfieldtype': u'Data', "no_copy": 1,
'permlevel': 1 "oldfieldtype": "Data",
}, "doctype": "DocField",
"label": "old_parent",
# DocField "oldfieldname": "old_parent",
{ "permlevel": 0,
'doctype': u'DocField', "fieldname": "old_parent",
'fieldname': u'cb0', "fieldtype": "Link",
'fieldtype': u'Column Break', "hidden": 1,
'permlevel': 0, "options": "Cost Center",
'width': u'50%' "report_hide": 1
}, },
{
# DocField "amend": 0,
{ "create": 0,
'colour': u'White:FFF', "doctype": "DocPerm",
'doctype': u'DocField', "submit": 0,
'fieldname': u'group_or_ledger', "write": 0,
'fieldtype': u'Select', "role": "Accounts Manager",
'hidden': 0, "cancel": 0,
'label': u'Group or Ledger', "permlevel": 1
'no_copy': 1, },
'oldfieldname': u'group_or_ledger', {
'oldfieldtype': u'Select', "amend": 0,
'options': u'\nGroup\nLedger', "create": 1,
'permlevel': 0, "doctype": "DocPerm",
'print_hide': 1, "submit": 0,
'report_hide': 1, "write": 1,
'reqd': 1, "role": "Accounts Manager",
'trigger': u'Client' "cancel": 1,
}, "permlevel": 0
},
# DocField {
{ "amend": 0,
'colour': u'White:FFF', "create": 0,
'description': u'Define Budget for this Cost Center. To set budget action, see <a href="#!List/Company">Company Master</a>', "doctype": "DocPerm",
'doctype': u'DocField', "submit": 0,
'fieldname': u'sb1', "write": 0,
'fieldtype': u'Section Break', "role": "Accounts User",
'label': u'Budget', "cancel": 0,
'permlevel': 0 "permlevel": 1
}, },
{
# DocField "amend": 0,
{ "create": 0,
'colour': u'White:FFF', "doctype": "DocPerm",
'description': u'Select Budget Distribution, if you want to track based on seasonality.', "submit": 0,
'doctype': u'DocField', "write": 0,
'fieldname': u'distribution_id', "role": "Accounts User",
'fieldtype': u'Link', "cancel": 0,
'label': u'Distribution Id', "permlevel": 0
'oldfieldname': u'distribution_id', },
'oldfieldtype': u'Link', {
'options': u'Budget Distribution', "create": 1,
'permlevel': 0 "doctype": "DocPerm",
}, "write": 1,
"role": "System Manager",
# DocField "cancel": 1,
{ "permlevel": 0
'colour': u'White:FFF', },
'description': u'Add rows to set annual budgets on Accounts.', {
'doctype': u'DocField', "doctype": "DocPerm",
'fieldname': u'budget_details', "role": "All",
'fieldtype': u'Table', "permlevel": 1
'label': u'Budget Details', }
'oldfieldname': u'budget_details',
'oldfieldtype': u'Table',
'options': u'Budget Detail',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'lft',
'fieldtype': u'Int',
'hidden': 1,
'in_filter': 1,
'label': u'lft',
'no_copy': 1,
'oldfieldname': u'lft',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
'search_index': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'rgt',
'fieldtype': u'Int',
'hidden': 1,
'in_filter': 1,
'label': u'rgt',
'no_copy': 1,
'oldfieldname': u'rgt',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
'reqd': 0,
'search_index': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'old_parent',
'fieldtype': u'Link',
'hidden': 1,
'label': u'old_parent',
'no_copy': 1,
'oldfieldname': u'old_parent',
'oldfieldtype': u'Data',
'options': u'Cost Center',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
}
] ]

View File

@ -53,12 +53,6 @@ pscript['onload_Accounts Browser'] = function(wrapper){
wrapper.$company_select.val(sys_defaults.company || r[0]).change(); wrapper.$company_select.val(sys_defaults.company || r[0]).change();
} }
}); });
// refresh on rename
$(document).bind('rename', function(event, dt, old_name, new_name) {
if(erpnext.account_chart.ctype==dt)
wrapper.$company_select.change();
});
} }
pscript.set_title = function(wrapper, ctype, val) { pscript.set_title = function(wrapper, ctype, val) {
@ -85,9 +79,9 @@ erpnext.AccountsChart = Class.extend({
$(wrapper).find('.tree-area').empty(); $(wrapper).find('.tree-area').empty();
var me = this; var me = this;
me.ctype = ctype; me.ctype = ctype;
me.can_create = wn.boot.profile.can_create.indexOf(this.ctype); me.can_create = wn.model.can_create(this.ctype);
me.can_delete = wn.model.can_delete(this.ctype); me.can_delete = wn.model.can_delete(this.ctype);
me.can_write = wn.boot.profile.can_write.indexOf(this.ctype); me.can_write = wn.model.can_write(this.ctype);
me.company = company; me.company = company;
@ -135,8 +129,7 @@ erpnext.AccountsChart = Class.extend({
var node_links = []; var node_links = [];
// edit // edit
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) { if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
node_links.push('<a href="#Form/'+encodeURIComponent(this.ctype)+'/' node_links.push('<a onclick="erpnext.account_chart.open();">Edit</a>');
+encodeURIComponent(data.value)+'">Edit</a>');
} }
if (data.expandable) { if (data.expandable) {
if(this.can_create) { if(this.can_create) {
@ -146,30 +139,34 @@ erpnext.AccountsChart = Class.extend({
node_links.push('<a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>'); node_links.push('<a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>');
} }
if (this.can_write !== -1) { if (this.can_write) {
node_links.push('<a onclick="erpnext.account_chart.rename()">Rename</a>'); node_links.push('<a onclick="erpnext.account_chart.rename()">Rename</a>');
}; };
if (this.can_delete !== -1) { if (this.can_delete) {
node_links.push('<a onclick="erpnext.account_chart.delete()">Delete</a>'); node_links.push('<a onclick="erpnext.account_chart.delete()">Delete</a>');
}; };
link.toolbar.append(node_links.join(" | ")); link.toolbar.append(node_links.join(" | "));
}, },
open: function() {
var node = this.selected_node();
wn.set_route("Form", this.ctype, node.data("label"));
},
show_ledger: function() { show_ledger: function() {
var me = this; var me = this;
var node = me.selected_node(); var node = me.selected_node();
wn.set_route("general-ledger", "account=" + node.data('label')); wn.set_route("general-ledger", "account=" + node.data('label'));
}, },
rename: function() { rename: function() {
var me = this; var node = this.selected_node();
var node = me.selected_node(); wn.model.rename_doc(this.ctype, node.data('label'), function(new_name) {
wn.model.rename_doc("Account", node.data('label')); node.data('label', new_name).find(".tree-label").html(new_name);
});
}, },
delete: function() { delete: function() {
var me = this; var node = this.selected_node();
var node = me.selected_node(); wn.model.delete_doc(this.ctype, node.data('label'), function() {
wn.model.delete_doc("Account", node.data('label'), function() {
node.parent().remove(); node.parent().remove();
}); });
}, },

View File

@ -159,7 +159,7 @@ class DocType(TransactionBase):
self.delete_supplier_communication() self.delete_supplier_communication()
self.delete_supplier_account() self.delete_supplier_account()
def on_rename(self,newdn,olddn): def on_rename(self, new, old):
#update supplier_name if not naming series #update supplier_name if not naming series
if get_defaults().get('supp_master_name') == 'Supplier Name': if get_defaults().get('supp_master_name') == 'Supplier Name':
update_fields = [ update_fields = [
@ -171,13 +171,14 @@ class DocType(TransactionBase):
('Purchase Receipt', 'supplier'), ('Purchase Receipt', 'supplier'),
('Serial No', 'supplier')] ('Serial No', 'supplier')]
for rec in update_fields: for rec in update_fields:
sql("update `tab%s` set supplier_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn)) sql("update `tab%s` set supplier_name = %s where `%s` = %s" % \
(rec[0], '%s', rec[1], '%s'), (new, old))
old_account = webnotes.conn.get_value("Account", {"master_type": "Supplier", for account in webnotes.conn.sql("""select name, account_name from
"master_name": olddn}) tabAccount where master_name=%s and master_type='Supplier'""", old, as_dict=1):
if account.account_name != new:
webnotes.rename_doc("Account", account.name, new)
#update master_name in doctype account #update master_name in doctype account
sql("update `tabAccount` set master_name = '%s', master_type = 'Supplier' where master_name = '%s'" %(newdn,olddn)) webnotes.conn.sql("""update `tabAccount` set master_name = %s,
master_type = 'Supplier' where master_name = %s""" , (new,old))
from webnotes.model.rename_doc import rename_doc
rename_doc("Account", old_account, newdn)

View File

@ -1,10 +1,13 @@
erpnext.updates = [ erpnext.updates = [
["6th December 2012", [
"Rename: Cost Center, Item Group, Customer Group, Supplier Type, Territory, Sales Person can now be renamed.",
]],
["5th December 2012", [ ["5th December 2012", [
"Leave Application: Now can set approver.", "Leave Application: Now can set approver.",
"New Roles Added: Leave Approver and Expense Approver.", "New Roles Added: Leave Approver and Expense Approver.",
"Production Order is now linked with sales order.", "Production Order: Now linked with Sales Order.",
"Production Planning Tool: The field 'Allow SA items as raw material' has been renamed to 'Use multi-level BOM', 'Include in plan' column from SO table has been deleted", "Production Planning Tool: The field 'Allow SA items as raw material' has been renamed to 'Use multi-level BOM', 'Include in plan' column from SO table has been deleted",
"Batch nos are now filtered with item and available qty", "Batch Numbers: Batch nos are now filtered with Item and available qty at time of selection in transactions.",
"BOM: 'Update Costing' button has been deleted, once submitted cost are fixed.", "BOM: 'Update Costing' button has been deleted, once submitted cost are fixed.",
"[For indian customer only] Deprecated TDS related documents and fields. Old TDS amount added into tax table in Purchase Invoice and entries table in case of JV", "[For indian customer only] Deprecated TDS related documents and fields. Old TDS amount added into tax table in Purchase Invoice and entries table in case of JV",
]], ]],

View File

@ -212,7 +212,7 @@ class DocType(TransactionBase):
if self.doc.lead_name: if self.doc.lead_name:
sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name) sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
def on_rename(self,newdn,olddn): def on_rename(self, new, old):
#update customer_name if not naming series #update customer_name if not naming series
if get_defaults().get('cust_master_name') == 'Customer Name': if get_defaults().get('cust_master_name') == 'Customer Name':
update_fields = [ update_fields = [
@ -235,13 +235,14 @@ class DocType(TransactionBase):
('Support Ticket', 'customer'), ('Support Ticket', 'customer'),
('Task', 'customer')] ('Task', 'customer')]
for rec in update_fields: for rec in update_fields:
sql("update `tab%s` set customer_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn)) sql("""update `tab%s` set customer_name = %s
where `%s` = %s""" % (rec[0], "%s" ,rec[1], "%s"), (new, old))
old_account = webnotes.conn.get_value("Account", {"master_type": "Customer", for account in webnotes.conn.sql("""select name, account_name from
"master_name": olddn}) tabAccount where master_name=%s and master_type='Customer'""", old, as_dict=1):
if account.account_name != new:
webnotes.rename_doc("Account", account.name, new)
#update master_name in doctype account #update master_name in doctype account
sql("update `tabAccount` set master_name = '%s', master_type = 'Customer' where master_name = '%s'" %(newdn,olddn)) webnotes.conn.sql("""update `tabAccount` set master_name = %s,
master_type = 'Customer' where master_name = %s""", (new,old))
from webnotes.model.rename_doc import rename_doc
rename_doc("Account", old_account, newdn)

View File

@ -84,9 +84,8 @@ erpnext.SalesChart = Class.extend({
// edit // edit
var node_links = []; var node_links = [];
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) { if (wn.model.can_read(this.ctype)) {
node_links.push('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/' node_links.push('<a onclick="erpnext.sales_chart.open();">Edit</a>');
+encodeURIComponent(data.value)+'">Edit</a>');
} }
if(data.expandable) { if(data.expandable) {
@ -96,6 +95,14 @@ erpnext.SalesChart = Class.extend({
} }
} }
if (wn.model.can_write(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.rename()">Rename</a>');
};
if (wn.model.can_delete(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.delete()">Delete</a>');
};
link.toolbar.append(node_links.join(" | ")); link.toolbar.append(node_links.join(" | "));
}, },
new_node: function() { new_node: function() {
@ -107,11 +114,12 @@ erpnext.SalesChart = Class.extend({
fields: [ fields: [
{fieldtype:'Data', fieldname: 'name_field', label:'New ' + me.ctype + ' Name', reqd:true}, {fieldtype:'Data', fieldname: 'name_field', label:'New ' + me.ctype + ' Name', reqd:true},
{fieldtype:'Select', fieldname:'is_group', label:'Group Node', {fieldtype:'Select', fieldname:'is_group', label:'Group Node',
options:'No\nYes', description:'Entries can made only against non-group (leaf) nodes'}, options:'No\nYes', description: "Further nodes can be only created under 'Group' type nodes"},
{fieldtype:'Button', fieldname:'create_new', label:'Create New' } {fieldtype:'Button', fieldname:'create_new', label:'Create New' }
] ]
}) })
d.set_value("is_group", "No");
// create // create
$(d.fields_dict.create_new.input).click(function() { $(d.fields_dict.create_new.input).click(function() {
var btn = this; var btn = this;
@ -138,5 +146,22 @@ erpnext.SalesChart = Class.extend({
}, },
selected_node: function() { selected_node: function() {
return this.tree.$w.find('.tree-link.selected'); return this.tree.$w.find('.tree-link.selected');
} },
open: function() {
var node = this.selected_node();
wn.set_route("Form", this.ctype, node.data("label"));
},
rename: function() {
var node = this.selected_node();
wn.model.rename_doc(this.ctype, node.data('label'), function(new_name) {
console.log(new_name)
node.data('label', new_name).find(".tree-label").html(new_name);
});
},
delete: function() {
var node = this.selected_node();
wn.model.delete_doc(this.ctype, node.data('label'), function() {
node.parent().remove();
});
},
}); });

View File

@ -1,241 +1,194 @@
# DocType, Customer Group
[ [
{
# These values are common in all dictionaries "owner": "Administrator",
{ "docstatus": 0,
'creation': '2012-07-03 13:30:55', "creation": "2012-07-12 23:29:45",
'docstatus': 0, "modified_by": "Administrator",
'modified': '2012-07-12 09:47:20', "modified": "2012-12-06 10:28:54"
'modified_by': u'Administrator', },
'owner': u'Administrator' {
}, "in_create": 1,
"search_fields": "name,parent_customer_group",
# These values are common for all DocType "module": "Setup",
{ "document_type": "Master",
'_last_update': u'1294214943', "read_only": 1,
'allow_trash': 1, "autoname": "field:customer_group_name",
'autoname': u'field:customer_group_name', "name": "__common__",
'colour': u'White:FFF', "default_print_format": "Standard",
'default_print_format': u'Standard', "allow_rename": 1,
'doctype': 'DocType', "doctype": "DocType"
'document_type': u'Master', },
'in_create': 1, {
'module': u'Setup', "name": "__common__",
'name': '__common__', "parent": "Customer Group",
'read_only': 1, "doctype": "DocField",
'search_fields': u'name,parent_customer_group', "parenttype": "DocType",
'section_style': u'Simple', "parentfield": "fields"
'server_code_error': u' ', },
'show_in_menu': 0, {
'version': 1 "name": "__common__",
}, "parent": "Customer Group",
"amend": 0,
# These values are common for all DocField "submit": 0,
{ "doctype": "DocPerm",
'doctype': u'DocField', "read": 1,
'name': '__common__', "parenttype": "DocType",
'parent': u'Customer Group', "parentfield": "permissions"
'parentfield': u'fields', },
'parenttype': u'DocType' {
}, "name": "Customer Group",
"doctype": "DocType"
# These values are common for all DocPerm },
{ {
'amend': 0, "oldfieldtype": "Small Text",
'doctype': u'DocPerm', "doctype": "DocField",
'name': '__common__', "label": "Trash Reason",
'parent': u'Customer Group', "oldfieldname": "trash_reason",
'parentfield': u'permissions', "fieldname": "trash_reason",
'parenttype': u'DocType', "fieldtype": "Small Text",
'read': 1, "permlevel": 1
'submit': 0 },
}, {
"no_copy": 1,
# DocType, Customer Group "oldfieldtype": "Data",
{ "doctype": "DocField",
'doctype': 'DocType', "label": "Customer Group Name",
'name': u'Customer Group' "oldfieldname": "customer_group_name",
}, "fieldname": "customer_group_name",
"fieldtype": "Data",
# DocPerm "reqd": 1,
{ "permlevel": 0
'cancel': 0, },
'create': 0, {
'doctype': u'DocPerm', "oldfieldtype": "Link",
'permlevel': 1, "colour": "White:FFF",
'role': u'Sales Manager', "doctype": "DocField",
'write': 0 "label": "Parent Customer Group",
}, "oldfieldname": "parent_customer_group",
"trigger": "Client",
# DocPerm "fieldname": "parent_customer_group",
{ "fieldtype": "Link",
'cancel': 0, "reqd": 1,
'create': 0, "options": "Customer Group",
'doctype': u'DocPerm', "permlevel": 0
'permlevel': 0, },
'role': u'Sales Manager', {
'write': 0 "description": "Only leaf nodes are allowed in transaction",
}, "oldfieldtype": "Select",
"colour": "White:FFF",
# DocPerm "doctype": "DocField",
{ "label": "Has Child Node",
'cancel': 0, "oldfieldname": "is_group",
'create': 0, "options": "\nYes\nNo",
'doctype': u'DocPerm', "fieldname": "is_group",
'permlevel': 1, "fieldtype": "Select",
'role': u'Sales Master Manager', "reqd": 1,
'write': 0 "permlevel": 0
}, },
{
# DocPerm "doctype": "DocField",
{ "fieldname": "cb0",
'cancel': 0, "fieldtype": "Column Break",
'create': 0, "permlevel": 0
'doctype': u'DocPerm', },
'permlevel': 1, {
'role': u'Sales User', "description": "This Price List will be selected as default for all Customers under this Group.",
'write': 0 "colour": "White:FFF",
}, "doctype": "DocField",
"label": "Default Price List",
# DocPerm "options": "Price List",
{ "fieldname": "default_price_list",
'cancel': 0, "fieldtype": "Link",
'create': 0, "permlevel": 0
'doctype': u'DocPerm', },
'permlevel': 0, {
'role': u'Sales User', "print_hide": 1,
'write': 0 "no_copy": 1,
}, "oldfieldtype": "Int",
"doctype": "DocField",
# DocPerm "label": "lft",
{ "oldfieldname": "lft",
'cancel': 1, "fieldname": "lft",
'create': 1, "fieldtype": "Int",
'doctype': u'DocPerm', "search_index": 1,
'permlevel': 0, "hidden": 1,
'role': u'Sales Master Manager', "permlevel": 0,
'write': 1 "report_hide": 1
}, },
{
# DocField "print_hide": 1,
{ "no_copy": 1,
'doctype': u'DocField', "oldfieldtype": "Int",
'fieldname': u'trash_reason', "doctype": "DocField",
'fieldtype': u'Small Text', "label": "rgt",
'label': u'Trash Reason', "oldfieldname": "rgt",
'oldfieldname': u'trash_reason', "fieldname": "rgt",
'oldfieldtype': u'Small Text', "fieldtype": "Int",
'permlevel': 1 "search_index": 1,
}, "hidden": 1,
"permlevel": 0,
# DocField "report_hide": 1
{ },
'doctype': u'DocField', {
'fieldname': u'customer_group_name', "print_hide": 1,
'fieldtype': u'Data', "no_copy": 1,
'label': u'Customer Group Name', "oldfieldtype": "Data",
'no_copy': 1, "doctype": "DocField",
'oldfieldname': u'customer_group_name', "label": "old_parent",
'oldfieldtype': u'Data', "oldfieldname": "old_parent",
'permlevel': 0, "permlevel": 0,
'reqd': 1 "fieldname": "old_parent",
}, "fieldtype": "Link",
"hidden": 1,
# DocField "options": "Customer Group",
{ "report_hide": 1
'colour': u'White:FFF', },
'doctype': u'DocField', {
'fieldname': u'parent_customer_group', "create": 0,
'fieldtype': u'Link', "doctype": "DocPerm",
'label': u'Parent Customer Group', "write": 0,
'oldfieldname': u'parent_customer_group', "role": "Sales Manager",
'oldfieldtype': u'Link', "cancel": 0,
'options': u'Customer Group', "permlevel": 1
'permlevel': 0, },
'reqd': 1, {
'trigger': u'Client' "create": 0,
}, "doctype": "DocPerm",
"write": 0,
# DocField "role": "Sales Manager",
{ "cancel": 0,
'colour': u'White:FFF', "permlevel": 0
'description': u'Only leaf nodes are allowed in transaction', },
'doctype': u'DocField', {
'fieldname': u'is_group', "create": 0,
'fieldtype': u'Select', "doctype": "DocPerm",
'label': u'Has Child Node', "write": 0,
'oldfieldname': u'is_group', "role": "Sales Master Manager",
'oldfieldtype': u'Select', "cancel": 0,
'options': u'\nYes\nNo', "permlevel": 1
'permlevel': 0, },
'reqd': 1 {
}, "create": 0,
"doctype": "DocPerm",
# DocField "write": 0,
{ "role": "Sales User",
'doctype': u'DocField', "cancel": 0,
'fieldname': u'cb0', "permlevel": 1
'fieldtype': u'Column Break', },
'permlevel': 0 {
}, "create": 0,
"doctype": "DocPerm",
# DocField "write": 0,
{ "role": "Sales User",
'colour': u'White:FFF', "cancel": 0,
'description': u'This Price List will be selected as default for all Customers under this Group.', "permlevel": 0
'doctype': u'DocField', },
'fieldname': u'default_price_list', {
'fieldtype': u'Link', "create": 1,
'label': u'Default Price List', "doctype": "DocPerm",
'options': u'Price List', "write": 1,
'permlevel': 0 "role": "Sales Master Manager",
}, "cancel": 1,
"permlevel": 0
# DocField }
{
'doctype': u'DocField',
'fieldname': u'lft',
'fieldtype': u'Int',
'hidden': 1,
'label': u'lft',
'no_copy': 1,
'oldfieldname': u'lft',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
'search_index': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'rgt',
'fieldtype': u'Int',
'hidden': 1,
'label': u'rgt',
'no_copy': 1,
'oldfieldname': u'rgt',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
'search_index': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'old_parent',
'fieldtype': u'Link',
'hidden': 1,
'label': u'old_parent',
'no_copy': 1,
'oldfieldname': u'old_parent',
'oldfieldtype': u'Data',
'options': u'Customer Group',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
}
] ]

View File

@ -1,275 +1,222 @@
# DocType, Sales Person
[ [
{
# These values are common in all dictionaries "owner": "Administrator",
{ "docstatus": 0,
'creation': '2012-07-03 13:30:54', "creation": "2012-07-12 23:29:44",
'docstatus': 0, "modified_by": "Administrator",
'modified': '2012-07-12 10:33:10', "modified": "2012-12-06 10:30:15"
'modified_by': u'Administrator', },
'owner': u'Administrator' {
}, "autoname": "field:sales_person_name",
"in_create": 1,
# These values are common for all DocType "name": "__common__",
{ "allow_rename": 1,
'_last_update': u'1302765705', "search_fields": "name,parent_sales_person",
'allow_trash': 1, "module": "Setup",
'autoname': u'field:sales_person_name', "doctype": "DocType",
'colour': u'White:FFF', "document_type": "Master",
'description': u'All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.', "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets."
'doctype': 'DocType', },
'document_type': u'Master', {
'in_create': 1, "name": "__common__",
'module': u'Setup', "parent": "Sales Person",
'name': '__common__', "doctype": "DocField",
'search_fields': u'name,parent_sales_person', "parenttype": "DocType",
'section_style': u'Simple', "parentfield": "fields"
'server_code_error': u' ', },
'show_in_menu': 0, {
'version': 1 "name": "__common__",
}, "parent": "Sales Person",
"amend": 0,
# These values are common for all DocField "submit": 0,
{ "doctype": "DocPerm",
'doctype': u'DocField', "read": 1,
'name': '__common__', "parenttype": "DocType",
'parent': u'Sales Person', "parentfield": "permissions"
'parentfield': u'fields', },
'parenttype': u'DocType' {
}, "name": "Sales Person",
"doctype": "DocType"
# These values are common for all DocPerm },
{ {
'amend': 0, "oldfieldtype": "Small Text",
'doctype': u'DocPerm', "doctype": "DocField",
'name': '__common__', "label": "Trash Reason",
'parent': u'Sales Person', "oldfieldname": "trash_reason",
'parentfield': u'permissions', "fieldname": "trash_reason",
'parenttype': u'DocType', "fieldtype": "Small Text",
'read': 1, "permlevel": 1
'submit': 0 },
}, {
"oldfieldtype": "Data",
# DocType, Sales Person "doctype": "DocField",
{ "label": "Sales Person Name",
'doctype': 'DocType', "oldfieldname": "sales_person_name",
'name': u'Sales Person' "fieldname": "sales_person_name",
}, "fieldtype": "Data",
"search_index": 0,
# DocPerm "reqd": 1,
{ "permlevel": 0,
'cancel': 0, "in_filter": 1
'create': 0, },
'doctype': u'DocPerm', {
'permlevel': 1, "description": "Select company name first.",
'role': u'Sales Manager', "oldfieldtype": "Link",
'write': 0 "colour": "White:FFF",
}, "doctype": "DocField",
"label": "Parent Sales Person",
# DocPerm "oldfieldname": "parent_sales_person",
{ "permlevel": 0,
'cancel': 0, "trigger": "Client",
'create': 0, "fieldname": "parent_sales_person",
'doctype': u'DocPerm', "fieldtype": "Link",
'permlevel': 0, "reqd": 1,
'role': u'Sales Manager', "options": "Sales Person"
'write': 0 },
}, {
"oldfieldtype": "Select",
# DocPerm "doctype": "DocField",
{ "label": "Has Child Node",
'cancel': 0, "oldfieldname": "is_group",
'create': 0, "options": "\nYes\nNo",
'doctype': u'DocPerm', "fieldname": "is_group",
'permlevel': 1, "fieldtype": "Select",
'role': u'Sales User', "reqd": 1,
'write': 0 "permlevel": 0
}, },
{
# DocPerm "doctype": "DocField",
{ "fieldname": "cb0",
'cancel': 0, "fieldtype": "Column Break",
'create': 0, "permlevel": 0
'doctype': u'DocPerm', },
'permlevel': 0, {
'role': u'Sales User', "doctype": "DocField",
'write': 0 "label": "Employee",
}, "options": "Employee",
"fieldname": "employee",
# DocPerm "fieldtype": "Link",
{ "permlevel": 0
'cancel': 1, },
'create': 1, {
'doctype': u'DocPerm', "print_hide": 1,
'permlevel': 0, "no_copy": 1,
'role': u'Sales Master Manager', "oldfieldtype": "Int",
'write': 1 "doctype": "DocField",
}, "label": "lft",
"oldfieldname": "lft",
# DocPerm "fieldname": "lft",
{ "fieldtype": "Int",
'cancel': 0, "search_index": 1,
'create': 0, "hidden": 1,
'doctype': u'DocPerm', "permlevel": 0,
'permlevel': 1, "in_filter": 1
'role': u'Sales Master Manager', },
'write': 0 {
}, "print_hide": 1,
"no_copy": 1,
# DocField "oldfieldtype": "Int",
{ "doctype": "DocField",
'doctype': u'DocField', "label": "rgt",
'fieldname': u'trash_reason', "oldfieldname": "rgt",
'fieldtype': u'Small Text', "fieldname": "rgt",
'label': u'Trash Reason', "fieldtype": "Int",
'oldfieldname': u'trash_reason', "search_index": 1,
'oldfieldtype': u'Small Text', "hidden": 1,
'permlevel': 1 "permlevel": 0,
}, "in_filter": 1
},
# DocField {
{ "print_hide": 1,
'doctype': u'DocField', "no_copy": 1,
'fieldname': u'sales_person_name', "oldfieldtype": "Data",
'fieldtype': u'Data', "doctype": "DocField",
'in_filter': 1, "label": "old_parent",
'label': u'Sales Person Name', "oldfieldname": "old_parent",
'oldfieldname': u'sales_person_name', "fieldname": "old_parent",
'oldfieldtype': u'Data', "fieldtype": "Data",
'permlevel': 0, "hidden": 1,
'reqd': 1, "permlevel": 0
'search_index': 0 },
}, {
"description": "Set targets Item Group-wise for this Sales Person.",
# DocField "oldfieldtype": "Section Break",
{ "colour": "White:FFF",
'colour': u'White:FFF', "doctype": "DocField",
'description': u'Select company name first.', "label": "Sales Person Targets",
'doctype': u'DocField', "fieldname": "target_details_section_break",
'fieldname': u'parent_sales_person', "fieldtype": "Section Break",
'fieldtype': u'Link', "permlevel": 0
'label': u'Parent Sales Person', },
'oldfieldname': u'parent_sales_person', {
'oldfieldtype': u'Link', "oldfieldtype": "Table",
'options': u'Sales Person', "doctype": "DocField",
'permlevel': 0, "label": "Target Details1",
'reqd': 1, "oldfieldname": "target_details",
'trigger': u'Client' "options": "Target Detail",
}, "fieldname": "target_details",
"fieldtype": "Table",
# DocField "permlevel": 0
{ },
'doctype': u'DocField', {
'fieldname': u'is_group', "description": "Select Budget Distribution to unevenly distribute targets across months.",
'fieldtype': u'Select', "oldfieldtype": "Link",
'label': u'Has Child Node', "colour": "White:FFF",
'oldfieldname': u'is_group', "doctype": "DocField",
'oldfieldtype': u'Select', "label": "Target Distribution",
'options': u'\nYes\nNo', "oldfieldname": "distribution_id",
'permlevel': 0, "options": "Budget Distribution",
'reqd': 1 "fieldname": "distribution_id",
}, "fieldtype": "Link",
"search_index": 0,
# DocField "permlevel": 0
{ },
'doctype': u'DocField', {
'fieldname': u'cb0', "create": 0,
'fieldtype': u'Column Break', "doctype": "DocPerm",
'permlevel': 0 "write": 0,
}, "role": "Sales Manager",
"cancel": 0,
# DocField "permlevel": 1
{ },
'doctype': u'DocField', {
'fieldname': u'employee', "create": 0,
'fieldtype': u'Link', "doctype": "DocPerm",
'label': u'Employee', "write": 0,
'options': u'Employee', "role": "Sales Manager",
'permlevel': 0 "cancel": 0,
}, "permlevel": 0
},
# DocField {
{ "create": 0,
'doctype': u'DocField', "doctype": "DocPerm",
'fieldname': u'lft', "write": 0,
'fieldtype': u'Int', "role": "Sales User",
'hidden': 1, "cancel": 0,
'in_filter': 1, "permlevel": 1
'label': u'lft', },
'no_copy': 1, {
'oldfieldname': u'lft', "create": 0,
'oldfieldtype': u'Int', "doctype": "DocPerm",
'permlevel': 0, "write": 0,
'print_hide': 1, "role": "Sales User",
'search_index': 1 "cancel": 0,
}, "permlevel": 0
},
# DocField {
{ "create": 1,
'doctype': u'DocField', "doctype": "DocPerm",
'fieldname': u'rgt', "write": 1,
'fieldtype': u'Int', "role": "Sales Master Manager",
'hidden': 1, "cancel": 1,
'in_filter': 1, "permlevel": 0
'label': u'rgt', },
'no_copy': 1, {
'oldfieldname': u'rgt', "create": 0,
'oldfieldtype': u'Int', "doctype": "DocPerm",
'permlevel': 0, "write": 0,
'print_hide': 1, "role": "Sales Master Manager",
'search_index': 1 "cancel": 0,
}, "permlevel": 1
}
# DocField
{
'doctype': u'DocField',
'fieldname': u'old_parent',
'fieldtype': u'Data',
'hidden': 1,
'label': u'old_parent',
'no_copy': 1,
'oldfieldname': u'old_parent',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'colour': u'White:FFF',
'description': u'Set targets Item Group-wise for this Sales Person.',
'doctype': u'DocField',
'fieldname': u'target_details_section_break',
'fieldtype': u'Section Break',
'label': u'Sales Person Targets',
'oldfieldtype': u'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'target_details',
'fieldtype': u'Table',
'label': u'Target Details1',
'oldfieldname': u'target_details',
'oldfieldtype': u'Table',
'options': u'Target Detail',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u'Select Budget Distribution to unevenly distribute targets across months.',
'doctype': u'DocField',
'fieldname': u'distribution_id',
'fieldtype': u'Link',
'label': u'Target Distribution',
'oldfieldname': u'distribution_id',
'oldfieldtype': u'Link',
'options': u'Budget Distribution',
'permlevel': 0,
'search_index': 0
}
] ]

View File

@ -1,127 +1,97 @@
# DocType, Supplier Type
[ [
{
# These values are common in all dictionaries "owner": "Administrator",
{ "docstatus": 0,
'creation': '2012-03-27 14:36:25', "creation": "2012-07-03 13:30:53",
'docstatus': 0, "modified_by": "Administrator",
'modified': '2012-03-27 14:36:25', "modified": "2012-12-06 10:29:04"
'modified_by': u'Administrator', },
'owner': u'Administrator' {
}, "autoname": "field:supplier_type",
"name": "__common__",
# These values are common for all DocType "allow_rename": 1,
{ "doctype": "DocType",
'allow_trash': 1, "module": "Setup",
'autoname': u'field:supplier_type', "document_type": "Master"
'colour': u'White:FFF', },
'doctype': 'DocType', {
'document_type': u'Master', "name": "__common__",
'module': u'Setup', "parent": "Supplier Type",
'name': '__common__', "doctype": "DocField",
'section_style': u'Simple', "parenttype": "DocType",
'server_code_error': u' ', "parentfield": "fields"
'show_in_menu': 0, },
'version': 3 {
}, "name": "__common__",
"parent": "Supplier Type",
# These values are common for all DocField "amend": 0,
{ "doctype": "DocPerm",
'doctype': u'DocField', "submit": 0,
'name': '__common__', "read": 1,
'parent': u'Supplier Type', "parenttype": "DocType",
'parentfield': u'fields', "parentfield": "permissions"
'parenttype': u'DocType' },
}, {
"name": "Supplier Type",
# These values are common for all DocPerm "doctype": "DocType"
{ },
'amend': 0, {
'doctype': u'DocPerm', "oldfieldtype": "Small Text",
'name': '__common__', "doctype": "DocField",
'parent': u'Supplier Type', "label": "Trash Reason",
'parentfield': u'permissions', "oldfieldname": "trash_reason",
'parenttype': u'DocType', "fieldname": "trash_reason",
'read': 1, "fieldtype": "Small Text",
'submit': 0 "permlevel": 1
}, },
{
# DocType, Supplier Type "oldfieldtype": "Data",
{ "doctype": "DocField",
'doctype': 'DocType', "label": "Supplier Type",
'name': u'Supplier Type' "oldfieldname": "supplier_type",
}, "fieldname": "supplier_type",
"fieldtype": "Data",
# DocPerm "reqd": 1,
{ "permlevel": 0
'cancel': 1, },
'create': 1, {
'doctype': u'DocPerm', "create": 0,
'permlevel': 0, "doctype": "DocPerm",
'role': u'Purchase Master Manager', "write": 0,
'write': 1 "role": "Purchase Manager",
}, "cancel": 0,
"permlevel": 1
# DocPerm },
{ {
'cancel': 0, "create": 0,
'create': 0, "doctype": "DocPerm",
'doctype': u'DocPerm', "write": 0,
'permlevel': 1, "role": "Purchase Manager",
'role': u'Purchase Manager', "cancel": 0,
'write': 0 "permlevel": 0
}, },
{
# DocPerm "create": 0,
{ "doctype": "DocPerm",
'cancel': 0, "write": 0,
'create': 0, "role": "Purchase User",
'doctype': u'DocPerm', "cancel": 0,
'permlevel': 0, "permlevel": 1
'role': u'Purchase Manager', },
'write': 0 {
}, "create": 0,
"doctype": "DocPerm",
# DocPerm "write": 0,
{ "role": "Purchase User",
'cancel': 0, "cancel": 0,
'create': 0, "permlevel": 0
'doctype': u'DocPerm', },
'permlevel': 1, {
'role': u'Purchase User', "create": 1,
'write': 0 "doctype": "DocPerm",
}, "write": 1,
"role": "Purchase Master Manager",
# DocPerm "cancel": 1,
{ "permlevel": 0
'cancel': 0, }
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Purchase User',
'write': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'trash_reason',
'fieldtype': u'Small Text',
'label': u'Trash Reason',
'oldfieldname': u'trash_reason',
'oldfieldtype': u'Small Text',
'permlevel': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'supplier_type',
'fieldtype': u'Data',
'label': u'Supplier Type',
'oldfieldname': u'supplier_type',
'oldfieldtype': u'Data',
'permlevel': 0,
'reqd': 1
}
] ]

View File

@ -1,286 +1,233 @@
# DocType, Territory
[ [
{
# These values are common in all dictionaries "owner": "Administrator",
{ "docstatus": 0,
'creation': '2012-07-03 13:30:55', "creation": "2012-07-12 23:29:44",
'docstatus': 0, "modified_by": "Administrator",
'modified': '2012-07-12 10:01:47', "modified": "2012-12-06 10:29:39"
'modified_by': u'Administrator', },
'owner': u'Administrator' {
}, "in_create": 1,
"search_fields": "name,parent_territory,territory_manager",
# These values are common for all DocType "module": "Setup",
{ "document_type": "Master",
'_last_update': u'1311621379', "description": "Classification of Customers by region",
'allow_trash': 1, "read_only": 1,
'autoname': u'field:territory_name', "autoname": "field:territory_name",
'colour': u'White:FFF', "name": "__common__",
'default_print_format': u'Standard', "default_print_format": "Standard",
'description': u'You can create **Territories** If your organization operates in multiple regions (could be countries, states or cities). Once you group **Customers** by **Territories**, you can set annual targets for each **Item Group** and get reports that will show your actual performance in the territory v/s what you had planned.', "allow_rename": 1,
'doctype': 'DocType', "doctype": "DocType",
'document_type': u'Master', "name_case": "Title Case"
'in_create': 1, },
'module': u'Setup', {
'name': '__common__', "name": "__common__",
'name_case': u'Title Case', "parent": "Territory",
'read_only': 1, "doctype": "DocField",
'search_fields': u'name,parent_territory,territory_manager', "parenttype": "DocType",
'section_style': u'Simple', "parentfield": "fields"
'server_code_error': u' ', },
'show_in_menu': 0, {
'version': 1 "name": "__common__",
}, "parent": "Territory",
"amend": 0,
# These values are common for all DocField "submit": 0,
{ "doctype": "DocPerm",
'doctype': u'DocField', "read": 1,
'name': '__common__', "parenttype": "DocType",
'parent': u'Territory', "parentfield": "permissions"
'parentfield': u'fields', },
'parenttype': u'DocType' {
}, "name": "Territory",
"doctype": "DocType"
# These values are common for all DocPerm },
{ {
'amend': 0, "oldfieldtype": "Small Text",
'doctype': u'DocPerm', "doctype": "DocField",
'name': '__common__', "label": "Trash Reason",
'parent': u'Territory', "oldfieldname": "trash_reason",
'parentfield': u'permissions', "fieldname": "trash_reason",
'parenttype': u'DocType', "fieldtype": "Small Text",
'read': 1, "permlevel": 1
'submit': 0 },
}, {
"no_copy": 1,
# DocType, Territory "oldfieldtype": "Data",
{ "doctype": "DocField",
'doctype': 'DocType', "label": "Territory Name",
'name': u'Territory' "oldfieldname": "territory_name",
}, "fieldname": "territory_name",
"fieldtype": "Data",
# DocPerm "reqd": 1,
{ "permlevel": 0
'cancel': 0, },
'create': 0, {
'doctype': u'DocPerm', "oldfieldtype": "Link",
'permlevel': 1, "doctype": "DocField",
'role': u'Sales Manager', "label": "Parent Territory",
'write': 0 "oldfieldname": "parent_territory",
}, "trigger": "Client",
"fieldname": "parent_territory",
# DocPerm "fieldtype": "Link",
{ "reqd": 1,
'cancel': 0, "options": "Territory",
'create': 0, "permlevel": 0
'doctype': u'DocPerm', },
'permlevel': 0, {
'role': u'Sales Manager', "description": "Only leaf nodes are allowed in transaction",
'write': 0 "oldfieldtype": "Select",
}, "colour": "White:FFF",
"doctype": "DocField",
# DocPerm "label": "Has Child Node",
{ "oldfieldname": "is_group",
'cancel': 0, "options": "\nYes\nNo",
'create': 0, "fieldname": "is_group",
'doctype': u'DocPerm', "fieldtype": "Select",
'permlevel': 1, "reqd": 1,
'role': u'Sales Master Manager', "permlevel": 0
'write': 0 },
}, {
"doctype": "DocField",
# DocPerm "fieldname": "cb0",
{ "fieldtype": "Column Break",
'cancel': 0, "permlevel": 0
'create': 0, },
'doctype': u'DocPerm', {
'permlevel': 1, "description": "For reference",
'role': u'Sales User', "oldfieldtype": "Link",
'write': 0 "colour": "White:FFF",
}, "doctype": "DocField",
"label": "Territory Manager",
# DocPerm "oldfieldname": "territory_manager",
{ "permlevel": 0,
'cancel': 0, "fieldname": "territory_manager",
'create': 0, "fieldtype": "Link",
'doctype': u'DocPerm', "search_index": 1,
'permlevel': 0, "in_filter": 1,
'role': u'Sales User', "options": "Sales Person"
'write': 0 },
}, {
"print_hide": 1,
# DocPerm "no_copy": 1,
{ "oldfieldtype": "Int",
'cancel': 1, "doctype": "DocField",
'create': 1, "label": "lft",
'doctype': u'DocPerm', "oldfieldname": "lft",
'permlevel': 0, "fieldname": "lft",
'role': u'Sales Master Manager', "fieldtype": "Int",
'write': 1 "search_index": 1,
}, "hidden": 1,
"permlevel": 0,
# DocField "report_hide": 0,
{ "in_filter": 1
'doctype': u'DocField', },
'fieldname': u'trash_reason', {
'fieldtype': u'Small Text', "print_hide": 1,
'label': u'Trash Reason', "no_copy": 1,
'oldfieldname': u'trash_reason', "oldfieldtype": "Int",
'oldfieldtype': u'Small Text', "doctype": "DocField",
'permlevel': 1 "label": "rgt",
}, "oldfieldname": "rgt",
"fieldname": "rgt",
# DocField "fieldtype": "Int",
{ "search_index": 1,
'doctype': u'DocField', "hidden": 1,
'fieldname': u'territory_name', "permlevel": 0,
'fieldtype': u'Data', "report_hide": 0,
'label': u'Territory Name', "in_filter": 1
'no_copy': 1, },
'oldfieldname': u'territory_name', {
'oldfieldtype': u'Data', "print_hide": 1,
'permlevel': 0, "no_copy": 1,
'reqd': 1 "oldfieldtype": "Data",
}, "doctype": "DocField",
"label": "old_parent",
# DocField "oldfieldname": "old_parent",
{ "permlevel": 0,
'doctype': u'DocField', "fieldname": "old_parent",
'fieldname': u'parent_territory', "fieldtype": "Link",
'fieldtype': u'Link', "hidden": 1,
'label': u'Parent Territory', "options": "Territory",
'oldfieldname': u'parent_territory', "report_hide": 1
'oldfieldtype': u'Link', },
'options': u'Territory', {
'permlevel': 0, "description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.",
'reqd': 1, "oldfieldtype": "Section Break",
'trigger': u'Client' "colour": "White:FFF",
}, "doctype": "DocField",
"label": "Territory Targets",
# DocField "fieldname": "target_details_section_break",
{ "fieldtype": "Section Break",
'colour': u'White:FFF', "permlevel": 0
'description': u'Only leaf nodes are allowed in transaction', },
'doctype': u'DocField', {
'fieldname': u'is_group', "oldfieldtype": "Table",
'fieldtype': u'Select', "doctype": "DocField",
'label': u'Has Child Node', "label": "Target Details",
'oldfieldname': u'is_group', "oldfieldname": "target_details",
'oldfieldtype': u'Select', "options": "Target Detail",
'options': u'\nYes\nNo', "fieldname": "target_details",
'permlevel': 0, "fieldtype": "Table",
'reqd': 1 "permlevel": 0
}, },
{
# DocField "description": "Select Budget Distribution to unevenly distribute targets across months.",
{ "oldfieldtype": "Link",
'doctype': u'DocField', "colour": "White:FFF",
'fieldname': u'cb0', "doctype": "DocField",
'fieldtype': u'Column Break', "label": "Target Distribution",
'permlevel': 0 "oldfieldname": "distribution_id",
}, "options": "Budget Distribution",
"fieldname": "distribution_id",
# DocField "fieldtype": "Link",
{ "permlevel": 0
'colour': u'White:FFF', },
'description': u'For reference', {
'doctype': u'DocField', "create": 0,
'fieldname': u'territory_manager', "doctype": "DocPerm",
'fieldtype': u'Link', "write": 0,
'in_filter': 1, "cancel": 0,
'label': u'Territory Manager', "role": "Sales Manager",
'oldfieldname': u'territory_manager', "permlevel": 1
'oldfieldtype': u'Link', },
'options': u'Sales Person', {
'permlevel': 0, "create": 0,
'search_index': 1 "doctype": "DocPerm",
}, "write": 0,
"cancel": 0,
# DocField "role": "Sales Manager",
{ "permlevel": 0
'doctype': u'DocField', },
'fieldname': u'lft', {
'fieldtype': u'Int', "create": 0,
'hidden': 1, "doctype": "DocPerm",
'in_filter': 1, "write": 0,
'label': u'lft', "cancel": 0,
'no_copy': 1, "role": "Sales Master Manager",
'oldfieldname': u'lft', "permlevel": 1
'oldfieldtype': u'Int', },
'permlevel': 0, {
'print_hide': 1, "create": 0,
'report_hide': 0, "doctype": "DocPerm",
'search_index': 1 "write": 0,
}, "cancel": 0,
"role": "Sales User",
# DocField "permlevel": 1
{ },
'doctype': u'DocField', {
'fieldname': u'rgt', "create": 0,
'fieldtype': u'Int', "doctype": "DocPerm",
'hidden': 1, "write": 0,
'in_filter': 1, "cancel": 0,
'label': u'rgt', "role": "Sales User",
'no_copy': 1, "permlevel": 0
'oldfieldname': u'rgt', },
'oldfieldtype': u'Int', {
'permlevel': 0, "create": 1,
'print_hide': 1, "doctype": "DocPerm",
'report_hide': 0, "write": 1,
'search_index': 1 "cancel": 1,
}, "role": "Sales Master Manager",
"permlevel": 0
# DocField }
{
'doctype': u'DocField',
'fieldname': u'old_parent',
'fieldtype': u'Link',
'hidden': 1,
'label': u'old_parent',
'no_copy': 1,
'oldfieldname': u'old_parent',
'oldfieldtype': u'Data',
'options': u'Territory',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
},
# DocField
{
'colour': u'White:FFF',
'description': u'Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.',
'doctype': u'DocField',
'fieldname': u'target_details_section_break',
'fieldtype': u'Section Break',
'label': u'Territory Targets',
'oldfieldtype': u'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'target_details',
'fieldtype': u'Table',
'label': u'Target Details',
'oldfieldname': u'target_details',
'oldfieldtype': u'Table',
'options': u'Target Detail',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u'Select Budget Distribution to unevenly distribute targets across months.',
'doctype': u'DocField',
'fieldname': u'distribution_id',
'fieldtype': u'Link',
'label': u'Target Distribution',
'oldfieldname': u'distribution_id',
'oldfieldtype': u'Link',
'options': u'Budget Distribution',
'permlevel': 0
}
] ]