more refactoring to renaming

This commit is contained in:
Rushabh Mehta 2012-12-06 12:09:52 +05:30
parent 2249d9d858
commit 76c4f61ffb
9 changed files with 812 additions and 971 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)
# on rename
def on_rename(self,newdn,olddn):
company_abbr = sql("select tc.abbr from `tabAccount` ta, `tabCompany` tc where ta.company = tc.name and ta.name=%s", olddn)[0][0]
parts = newdn.split(" - ")
def on_rename(self, new, old):
company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
parts = new.split(" - ")
if parts[-1].lower() != company_abbr.lower():
parts.append(company_abbr)
# rename account name
account_name = " - ".join(parts[:-1])
sql("update `tabAccount` set account_name = '%s' where name = '%s'" % \
(account_name,olddn))
(account_name, old))
return " - ".join(parts)

View File

@ -53,12 +53,6 @@ pscript['onload_Accounts Browser'] = function(wrapper){
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) {
@ -85,9 +79,9 @@ erpnext.AccountsChart = Class.extend({
$(wrapper).find('.tree-area').empty();
var me = this;
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_write = wn.boot.profile.can_write.indexOf(this.ctype);
me.can_write = wn.model.can_write(this.ctype);
me.company = company;
@ -135,8 +129,7 @@ erpnext.AccountsChart = Class.extend({
var node_links = [];
// edit
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
node_links.push('<a href="#Form/'+encodeURIComponent(this.ctype)+'/'
+encodeURIComponent(data.value)+'">Edit</a>');
node_links.push('<a onclick="erpnext.account_chart.open();">Edit</a>');
}
if (data.expandable) {
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>');
}
if (this.can_write !== -1) {
if (this.can_write) {
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>');
};
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() {
var me = this;
var node = me.selected_node();
wn.set_route("general-ledger", "account=" + node.data('label'));
},
rename: function() {
var me = this;
var node = me.selected_node();
wn.model.rename_doc("Account", node.data('label'));
var node = this.selected_node();
wn.model.rename_doc(this.ctype, node.data('label'), function(new_name) {
node.data('label', new_name).find(".tree-label").html(new_name);
});
},
delete: function() {
var me = this;
var node = me.selected_node();
wn.model.delete_doc("Account", node.data('label'), function() {
var node = this.selected_node();
wn.model.delete_doc(this.ctype, node.data('label'), function() {
node.parent().remove();
});
},

View File

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

View File

@ -212,7 +212,7 @@ class DocType(TransactionBase):
if 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
if get_defaults().get('cust_master_name') == 'Customer Name':
update_fields = [
@ -235,13 +235,14 @@ class DocType(TransactionBase):
('Support Ticket', 'customer'),
('Task', 'customer')]
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",
"master_name": olddn})
for account in webnotes.conn.sql("""select name, account_name from
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
sql("update `tabAccount` set master_name = '%s', master_type = 'Customer' where master_name = '%s'" %(newdn,olddn))
from webnotes.model.rename_doc import rename_doc
rename_doc("Account", old_account, newdn)
webnotes.conn.sql("""update `tabAccount` set master_name = %s,
master_type = 'Customer' where master_name = %s""", (new,old))

View File

@ -84,9 +84,8 @@ erpnext.SalesChart = Class.extend({
// edit
var node_links = [];
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
node_links.push('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
+encodeURIComponent(data.value)+'">Edit</a>');
if (wn.model.can_read(this.ctype)) {
node_links.push('<a onclick="erpnext.sales_chart.open();">Edit</a>');
}
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(" | "));
},
new_node: function() {
@ -107,11 +114,12 @@ erpnext.SalesChart = Class.extend({
fields: [
{fieldtype:'Data', fieldname: 'name_field', label:'New ' + me.ctype + ' Name', reqd:true},
{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' }
]
})
d.set_value("is_group", "No");
// create
$(d.fields_dict.create_new.input).click(function() {
var btn = this;
@ -138,5 +146,22 @@ erpnext.SalesChart = Class.extend({
},
selected_node: function() {
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
{
'creation': '2012-07-03 13:30:55',
'docstatus': 0,
'modified': '2012-07-12 09:47:20',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': u'1294214943',
'allow_trash': 1,
'autoname': u'field:customer_group_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Master',
'in_create': 1,
'module': u'Setup',
'name': '__common__',
'read_only': 1,
'search_fields': u'name,parent_customer_group',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 1
},
# These values are common for all DocField
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Customer Group',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# These values are common for all DocPerm
{
'amend': 0,
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Customer Group',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1,
'submit': 0
},
# DocType, Customer Group
{
'doctype': 'DocType',
'name': u'Customer Group'
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales Manager',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales Manager',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales Master Manager',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales User',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales User',
'write': 0
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales Master Manager',
'write': 1
},
# 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'customer_group_name',
'fieldtype': u'Data',
'label': u'Customer Group Name',
'no_copy': 1,
'oldfieldname': u'customer_group_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'parent_customer_group',
'fieldtype': u'Link',
'label': u'Parent Customer Group',
'oldfieldname': u'parent_customer_group',
'oldfieldtype': u'Link',
'options': u'Customer Group',
'permlevel': 0,
'reqd': 1,
'trigger': u'Client'
},
# DocField
{
'colour': u'White:FFF',
'description': u'Only leaf nodes are allowed in transaction',
'doctype': u'DocField',
'fieldname': u'is_group',
'fieldtype': u'Select',
'label': u'Has Child Node',
'oldfieldname': u'is_group',
'oldfieldtype': u'Select',
'options': u'\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'cb0',
'fieldtype': u'Column Break',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u'This Price List will be selected as default for all Customers under this Group.',
'doctype': u'DocField',
'fieldname': u'default_price_list',
'fieldtype': u'Link',
'label': u'Default Price List',
'options': u'Price List',
'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
}
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-07-12 23:29:45",
"modified_by": "Administrator",
"modified": "2012-12-06 10:28:54"
},
{
"in_create": 1,
"search_fields": "name,parent_customer_group",
"module": "Setup",
"document_type": "Master",
"read_only": 1,
"autoname": "field:customer_group_name",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},
{
"name": "__common__",
"parent": "Customer Group",
"doctype": "DocField",
"parenttype": "DocType",
"parentfield": "fields"
},
{
"name": "__common__",
"parent": "Customer Group",
"amend": 0,
"submit": 0,
"doctype": "DocPerm",
"read": 1,
"parenttype": "DocType",
"parentfield": "permissions"
},
{
"name": "Customer Group",
"doctype": "DocType"
},
{
"oldfieldtype": "Small Text",
"doctype": "DocField",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"permlevel": 1
},
{
"no_copy": 1,
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Customer Group Name",
"oldfieldname": "customer_group_name",
"fieldname": "customer_group_name",
"fieldtype": "Data",
"reqd": 1,
"permlevel": 0
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Parent Customer Group",
"oldfieldname": "parent_customer_group",
"trigger": "Client",
"fieldname": "parent_customer_group",
"fieldtype": "Link",
"reqd": 1,
"options": "Customer Group",
"permlevel": 0
},
{
"description": "Only leaf nodes are allowed in transaction",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Has Child Node",
"oldfieldname": "is_group",
"options": "\nYes\nNo",
"fieldname": "is_group",
"fieldtype": "Select",
"reqd": 1,
"permlevel": 0
},
{
"doctype": "DocField",
"fieldname": "cb0",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"description": "This Price List will be selected as default for all Customers under this Group.",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Default Price List",
"options": "Price List",
"fieldname": "default_price_list",
"fieldtype": "Link",
"permlevel": 0
},
{
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Int",
"doctype": "DocField",
"label": "lft",
"oldfieldname": "lft",
"fieldname": "lft",
"fieldtype": "Int",
"search_index": 1,
"hidden": 1,
"permlevel": 0,
"report_hide": 1
},
{
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Int",
"doctype": "DocField",
"label": "rgt",
"oldfieldname": "rgt",
"fieldname": "rgt",
"fieldtype": "Int",
"search_index": 1,
"hidden": 1,
"permlevel": 0,
"report_hide": 1
},
{
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "old_parent",
"oldfieldname": "old_parent",
"permlevel": 0,
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
"options": "Customer Group",
"report_hide": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Sales Manager",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Sales Manager",
"cancel": 0,
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Sales Master Manager",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Sales User",
"cancel": 0,
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Sales User",
"cancel": 0,
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "Sales Master Manager",
"cancel": 1,
"permlevel": 0
}
]

View File

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

View File

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

View File

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