Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
ec61492c40
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -1,319 +1,262 @@
|
|||||||
# DocType, Cost Center
|
|
||||||
[
|
[
|
||||||
|
|
||||||
# These values are common in all dictionaries
|
|
||||||
{
|
{
|
||||||
'creation': '2012-07-03 13:30:47',
|
"owner": "Administrator",
|
||||||
'docstatus': 0,
|
"docstatus": 0,
|
||||||
'modified': '2012-07-11 14:41:39',
|
"creation": "2012-07-12 23:29:41",
|
||||||
'modified_by': u'Administrator',
|
"modified_by": "Administrator",
|
||||||
'owner': u'Administrator'
|
"modified": "2012-12-06 12:12:46"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
|
||||||
{
|
{
|
||||||
'_last_update': u'1317365120',
|
"in_create": 1,
|
||||||
'allow_copy': 1,
|
"search_fields": "name,parent_cost_center",
|
||||||
'allow_trash': 1,
|
"module": "Accounts",
|
||||||
'autoname': u'field:cost_center_name',
|
"document_type": "Master",
|
||||||
'colour': u'White:FFF',
|
"description": "Track separate Income and Expense for product verticals or divisions.",
|
||||||
'default_print_format': u'Standard',
|
"autoname": "field:cost_center_name",
|
||||||
'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**.',
|
"name": "__common__",
|
||||||
'doctype': 'DocType',
|
"default_print_format": "Standard",
|
||||||
'document_type': u'Master',
|
"allow_rename": 1,
|
||||||
'in_create': 1,
|
"doctype": "DocType",
|
||||||
'module': u'Accounts',
|
"allow_copy": 1
|
||||||
'name': '__common__',
|
|
||||||
'search_fields': u'name,parent_cost_center',
|
|
||||||
'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__",
|
||||||
'name': '__common__',
|
"parent": "Cost Center",
|
||||||
'parent': u'Cost Center',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"parenttype": "DocType",
|
||||||
'parenttype': u'DocType'
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocPerm',
|
"name": "__common__",
|
||||||
'name': '__common__',
|
"parent": "Cost Center",
|
||||||
'parent': u'Cost Center',
|
"read": 1,
|
||||||
'parentfield': u'permissions',
|
"doctype": "DocPerm",
|
||||||
'parenttype': u'DocType',
|
"parenttype": "DocType",
|
||||||
'read': 1
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Cost Center
|
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"name": "Cost Center",
|
||||||
'name': u'Cost Center'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"doctype": "DocField",
|
||||||
'cancel': 0,
|
"label": "Cost Center Details",
|
||||||
'create': 0,
|
"fieldname": "sb0",
|
||||||
'doctype': u'DocPerm',
|
"fieldtype": "Section Break",
|
||||||
'permlevel': 1,
|
"permlevel": 0
|
||||||
'role': u'Accounts Manager',
|
|
||||||
'submit': 0,
|
|
||||||
'write': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"oldfieldtype": "Small Text",
|
||||||
'cancel': 1,
|
"doctype": "DocField",
|
||||||
'create': 1,
|
"label": "Trash Reason",
|
||||||
'doctype': u'DocPerm',
|
"oldfieldname": "trash_reason",
|
||||||
'permlevel': 0,
|
"fieldname": "trash_reason",
|
||||||
'role': u'Accounts Manager',
|
"fieldtype": "Small Text",
|
||||||
'submit': 0,
|
"permlevel": 1
|
||||||
'write': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"no_copy": 1,
|
||||||
'cancel': 0,
|
"oldfieldtype": "Data",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Cost Center Name",
|
||||||
'permlevel': 1,
|
"oldfieldname": "cost_center_name",
|
||||||
'role': u'Accounts User',
|
"fieldname": "cost_center_name",
|
||||||
'submit': 0,
|
"fieldtype": "Data",
|
||||||
'write': 0
|
"search_index": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"in_filter": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"oldfieldtype": "Link",
|
||||||
'cancel': 0,
|
"colour": "White:FFF",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Parent Cost Center",
|
||||||
'permlevel': 0,
|
"oldfieldname": "parent_cost_center",
|
||||||
'role': u'Accounts User',
|
"trigger": "Client",
|
||||||
'submit': 0,
|
"fieldname": "parent_cost_center",
|
||||||
'write': 0
|
"fieldtype": "Link",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "Cost Center",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
"oldfieldtype": "Link",
|
||||||
'create': 1,
|
"colour": "White:FFF",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "Company",
|
||||||
'role': u'System Manager',
|
"oldfieldname": "company_name",
|
||||||
'write': 1
|
"trigger": "Client",
|
||||||
|
"fieldname": "company_name",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "Company",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocPerm',
|
"oldfieldtype": "Data",
|
||||||
'permlevel': 1,
|
"colour": "White:FFF",
|
||||||
'role': u'All'
|
"doctype": "DocField",
|
||||||
|
"label": "Company Abbr",
|
||||||
|
"oldfieldname": "company_abbr",
|
||||||
|
"fieldname": "company_abbr",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'sb0',
|
"width": "50%",
|
||||||
'fieldtype': u'Section Break',
|
"fieldname": "cb0",
|
||||||
'label': u'Cost Center Details',
|
"fieldtype": "Column Break",
|
||||||
'permlevel': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'trash_reason',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Small Text',
|
"oldfieldtype": "Select",
|
||||||
'label': u'Trash Reason',
|
"colour": "White:FFF",
|
||||||
'oldfieldname': u'trash_reason',
|
"doctype": "DocField",
|
||||||
'oldfieldtype': u'Small Text',
|
"label": "Group or Ledger",
|
||||||
'permlevel': 1
|
"oldfieldname": "group_or_ledger",
|
||||||
|
"permlevel": 0,
|
||||||
|
"trigger": "Client",
|
||||||
|
"fieldname": "group_or_ledger",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"reqd": 1,
|
||||||
|
"hidden": 0,
|
||||||
|
"options": "\nGroup\nLedger",
|
||||||
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"description": "Define Budget for this Cost Center. To set budget action, see <a href=\"#!List/Company\">Company Master</a>",
|
||||||
'fieldname': u'cost_center_name',
|
"colour": "White:FFF",
|
||||||
'fieldtype': u'Data',
|
"doctype": "DocField",
|
||||||
'in_filter': 0,
|
"label": "Budget",
|
||||||
'label': u'Cost Center Name',
|
"fieldname": "sb1",
|
||||||
'no_copy': 1,
|
"fieldtype": "Section Break",
|
||||||
'oldfieldname': u'cost_center_name',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Data',
|
|
||||||
'permlevel': 0,
|
|
||||||
'reqd': 1,
|
|
||||||
'search_index': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"description": "Select Budget Distribution, if you want to track based on seasonality.",
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Link",
|
||||||
'fieldname': u'parent_cost_center',
|
"colour": "White:FFF",
|
||||||
'fieldtype': u'Link',
|
"doctype": "DocField",
|
||||||
'label': u'Parent Cost Center',
|
"label": "Distribution Id",
|
||||||
'oldfieldname': u'parent_cost_center',
|
"oldfieldname": "distribution_id",
|
||||||
'oldfieldtype': u'Link',
|
"options": "Budget Distribution",
|
||||||
'options': u'Cost Center',
|
"fieldname": "distribution_id",
|
||||||
'permlevel': 0,
|
"fieldtype": "Link",
|
||||||
'reqd': 1,
|
"permlevel": 0
|
||||||
'trigger': u'Client'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"description": "Add rows to set annual budgets on Accounts.",
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Table",
|
||||||
'fieldname': u'company_name',
|
"colour": "White:FFF",
|
||||||
'fieldtype': u'Link',
|
"doctype": "DocField",
|
||||||
'label': u'Company',
|
"label": "Budget Details",
|
||||||
'oldfieldname': u'company_name',
|
"oldfieldname": "budget_details",
|
||||||
'oldfieldtype': u'Link',
|
"options": "Budget Detail",
|
||||||
'options': u'Company',
|
"fieldname": "budget_details",
|
||||||
'permlevel': 0,
|
"fieldtype": "Table",
|
||||||
'reqd': 1,
|
"permlevel": 0
|
||||||
'trigger': u'Client'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"print_hide": 1,
|
||||||
'doctype': u'DocField',
|
"no_copy": 1,
|
||||||
'fieldname': u'company_abbr',
|
"oldfieldtype": "Int",
|
||||||
'fieldtype': u'Data',
|
"doctype": "DocField",
|
||||||
'hidden': 1,
|
"label": "lft",
|
||||||
'label': u'Company Abbr',
|
"oldfieldname": "lft",
|
||||||
'oldfieldname': u'company_abbr',
|
"fieldname": "lft",
|
||||||
'oldfieldtype': u'Data',
|
"fieldtype": "Int",
|
||||||
'permlevel': 1
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 1,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'cb0',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Column Break',
|
"oldfieldtype": "Int",
|
||||||
'permlevel': 0,
|
"doctype": "DocField",
|
||||||
'width': u'50%'
|
"label": "rgt",
|
||||||
|
"oldfieldname": "rgt",
|
||||||
|
"fieldname": "rgt",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"search_index": 1,
|
||||||
|
"reqd": 0,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 1,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"print_hide": 1,
|
||||||
'doctype': u'DocField',
|
"no_copy": 1,
|
||||||
'fieldname': u'group_or_ledger',
|
"oldfieldtype": "Data",
|
||||||
'fieldtype': u'Select',
|
"doctype": "DocField",
|
||||||
'hidden': 0,
|
"label": "old_parent",
|
||||||
'label': u'Group or Ledger',
|
"oldfieldname": "old_parent",
|
||||||
'no_copy': 1,
|
"permlevel": 0,
|
||||||
'oldfieldname': u'group_or_ledger',
|
"fieldname": "old_parent",
|
||||||
'oldfieldtype': u'Select',
|
"fieldtype": "Link",
|
||||||
'options': u'\nGroup\nLedger',
|
"hidden": 1,
|
||||||
'permlevel': 0,
|
"options": "Cost Center",
|
||||||
'print_hide': 1,
|
"report_hide": 1
|
||||||
'report_hide': 1,
|
|
||||||
'reqd': 1,
|
|
||||||
'trigger': u'Client'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"amend": 0,
|
||||||
'description': u'Define Budget for this Cost Center. To set budget action, see <a href="#!List/Company">Company Master</a>',
|
"create": 0,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'sb1',
|
"submit": 0,
|
||||||
'fieldtype': u'Section Break',
|
"write": 0,
|
||||||
'label': u'Budget',
|
"role": "Accounts Manager",
|
||||||
'permlevel': 0
|
"cancel": 0,
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"amend": 0,
|
||||||
'description': u'Select Budget Distribution, if you want to track based on seasonality.',
|
"create": 1,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'distribution_id',
|
"submit": 0,
|
||||||
'fieldtype': u'Link',
|
"write": 1,
|
||||||
'label': u'Distribution Id',
|
"role": "Accounts Manager",
|
||||||
'oldfieldname': u'distribution_id',
|
"cancel": 1,
|
||||||
'oldfieldtype': u'Link',
|
"permlevel": 0
|
||||||
'options': u'Budget Distribution',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"amend": 0,
|
||||||
'description': u'Add rows to set annual budgets on Accounts.',
|
"create": 0,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'budget_details',
|
"submit": 0,
|
||||||
'fieldtype': u'Table',
|
"write": 0,
|
||||||
'label': u'Budget Details',
|
"role": "Accounts User",
|
||||||
'oldfieldname': u'budget_details',
|
"cancel": 0,
|
||||||
'oldfieldtype': u'Table',
|
"permlevel": 1
|
||||||
'options': u'Budget Detail',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"amend": 0,
|
||||||
'fieldname': u'lft',
|
"create": 0,
|
||||||
'fieldtype': u'Int',
|
"doctype": "DocPerm",
|
||||||
'hidden': 1,
|
"submit": 0,
|
||||||
'in_filter': 1,
|
"write": 0,
|
||||||
'label': u'lft',
|
"role": "Accounts User",
|
||||||
'no_copy': 1,
|
"cancel": 0,
|
||||||
'oldfieldname': u'lft',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 1,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'rgt',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 1,
|
||||||
'hidden': 1,
|
"role": "System Manager",
|
||||||
'in_filter': 1,
|
"cancel": 1,
|
||||||
'label': u'rgt',
|
"permlevel": 0
|
||||||
'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',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'old_parent',
|
"role": "All",
|
||||||
'fieldtype': u'Link',
|
"permlevel": 1
|
||||||
'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
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -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();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -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)
|
|
||||||
|
@ -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",
|
||||||
]],
|
]],
|
||||||
|
@ -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)
|
|
||||||
|
@ -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();
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
@ -1,241 +1,194 @@
|
|||||||
# DocType, Customer Group
|
|
||||||
[
|
[
|
||||||
|
|
||||||
# These values are common in all dictionaries
|
|
||||||
{
|
{
|
||||||
'creation': '2012-07-03 13:30:55',
|
"owner": "Administrator",
|
||||||
'docstatus': 0,
|
"docstatus": 0,
|
||||||
'modified': '2012-07-12 09:47:20',
|
"creation": "2012-07-12 23:29:45",
|
||||||
'modified_by': u'Administrator',
|
"modified_by": "Administrator",
|
||||||
'owner': u'Administrator'
|
"modified": "2012-12-06 10:28:54"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
|
||||||
{
|
{
|
||||||
'_last_update': u'1294214943',
|
"in_create": 1,
|
||||||
'allow_trash': 1,
|
"search_fields": "name,parent_customer_group",
|
||||||
'autoname': u'field:customer_group_name',
|
"module": "Setup",
|
||||||
'colour': u'White:FFF',
|
"document_type": "Master",
|
||||||
'default_print_format': u'Standard',
|
"read_only": 1,
|
||||||
'doctype': 'DocType',
|
"autoname": "field:customer_group_name",
|
||||||
'document_type': u'Master',
|
"name": "__common__",
|
||||||
'in_create': 1,
|
"default_print_format": "Standard",
|
||||||
'module': u'Setup',
|
"allow_rename": 1,
|
||||||
'name': '__common__',
|
"doctype": "DocType"
|
||||||
'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__",
|
||||||
'name': '__common__',
|
"parent": "Customer Group",
|
||||||
'parent': u'Customer Group',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"parenttype": "DocType",
|
||||||
'parenttype': u'DocType'
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"name": "__common__",
|
||||||
'doctype': u'DocPerm',
|
"parent": "Customer Group",
|
||||||
'name': '__common__',
|
"amend": 0,
|
||||||
'parent': u'Customer Group',
|
"submit": 0,
|
||||||
'parentfield': u'permissions',
|
"doctype": "DocPerm",
|
||||||
'parenttype': u'DocType',
|
"read": 1,
|
||||||
'read': 1,
|
"parenttype": "DocType",
|
||||||
'submit': 0
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Customer Group
|
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"name": "Customer Group",
|
||||||
'name': u'Customer Group'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Small Text",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Trash Reason",
|
||||||
'permlevel': 1,
|
"oldfieldname": "trash_reason",
|
||||||
'role': u'Sales Manager',
|
"fieldname": "trash_reason",
|
||||||
'write': 0
|
"fieldtype": "Small Text",
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"no_copy": 1,
|
||||||
'create': 0,
|
"oldfieldtype": "Data",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "Customer Group Name",
|
||||||
'role': u'Sales Manager',
|
"oldfieldname": "customer_group_name",
|
||||||
'write': 0
|
"fieldname": "customer_group_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Link",
|
||||||
'create': 0,
|
"colour": "White:FFF",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 1,
|
"label": "Parent Customer Group",
|
||||||
'role': u'Sales Master Manager',
|
"oldfieldname": "parent_customer_group",
|
||||||
'write': 0
|
"trigger": "Client",
|
||||||
|
"fieldname": "parent_customer_group",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "Customer Group",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
'create': 0,
|
"oldfieldtype": "Select",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'permlevel': 1,
|
"doctype": "DocField",
|
||||||
'role': u'Sales User',
|
"label": "Has Child Node",
|
||||||
'write': 0
|
"oldfieldname": "is_group",
|
||||||
|
"options": "\nYes\nNo",
|
||||||
|
"fieldname": "is_group",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"doctype": "DocField",
|
||||||
'create': 0,
|
"fieldname": "cb0",
|
||||||
'doctype': u'DocPerm',
|
"fieldtype": "Column Break",
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'role': u'Sales User',
|
|
||||||
'write': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
"description": "This Price List will be selected as default for all Customers under this Group.",
|
||||||
'create': 1,
|
"colour": "White:FFF",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "Default Price List",
|
||||||
'role': u'Sales Master Manager',
|
"options": "Price List",
|
||||||
'write': 1
|
"fieldname": "default_price_list",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'trash_reason',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Small Text',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Trash Reason',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'trash_reason',
|
"label": "lft",
|
||||||
'oldfieldtype': u'Small Text',
|
"oldfieldname": "lft",
|
||||||
'permlevel': 1
|
"fieldname": "lft",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'customer_group_name',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Data',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Customer Group Name',
|
"doctype": "DocField",
|
||||||
'no_copy': 1,
|
"label": "rgt",
|
||||||
'oldfieldname': u'customer_group_name',
|
"oldfieldname": "rgt",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "rgt",
|
||||||
'permlevel': 0,
|
"fieldtype": "Int",
|
||||||
'reqd': 1
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"print_hide": 1,
|
||||||
'doctype': u'DocField',
|
"no_copy": 1,
|
||||||
'fieldname': u'parent_customer_group',
|
"oldfieldtype": "Data",
|
||||||
'fieldtype': u'Link',
|
"doctype": "DocField",
|
||||||
'label': u'Parent Customer Group',
|
"label": "old_parent",
|
||||||
'oldfieldname': u'parent_customer_group',
|
"oldfieldname": "old_parent",
|
||||||
'oldfieldtype': u'Link',
|
"permlevel": 0,
|
||||||
'options': u'Customer Group',
|
"fieldname": "old_parent",
|
||||||
'permlevel': 0,
|
"fieldtype": "Link",
|
||||||
'reqd': 1,
|
"hidden": 1,
|
||||||
'trigger': u'Client'
|
"options": "Customer Group",
|
||||||
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 0,
|
||||||
'description': u'Only leaf nodes are allowed in transaction',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'is_group',
|
"role": "Sales Manager",
|
||||||
'fieldtype': u'Select',
|
"cancel": 0,
|
||||||
'label': u'Has Child Node',
|
"permlevel": 1
|
||||||
'oldfieldname': u'is_group',
|
|
||||||
'oldfieldtype': u'Select',
|
|
||||||
'options': u'\nYes\nNo',
|
|
||||||
'permlevel': 0,
|
|
||||||
'reqd': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'cb0',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Column Break',
|
"write": 0,
|
||||||
'permlevel': 0
|
"role": "Sales Manager",
|
||||||
|
"cancel": 0,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 0,
|
||||||
'description': u'This Price List will be selected as default for all Customers under this Group.',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'default_price_list',
|
"role": "Sales Master Manager",
|
||||||
'fieldtype': u'Link',
|
"cancel": 0,
|
||||||
'label': u'Default Price List',
|
"permlevel": 1
|
||||||
'options': u'Price List',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'lft',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"role": "Sales User",
|
||||||
'label': u'lft',
|
"cancel": 0,
|
||||||
'no_copy': 1,
|
"permlevel": 1
|
||||||
'oldfieldname': u'lft',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 1,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'rgt',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"role": "Sales User",
|
||||||
'label': u'rgt',
|
"cancel": 0,
|
||||||
'no_copy': 1,
|
"permlevel": 0
|
||||||
'oldfieldname': u'rgt',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 1,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'old_parent',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Link',
|
"write": 1,
|
||||||
'hidden': 1,
|
"role": "Sales Master Manager",
|
||||||
'label': u'old_parent',
|
"cancel": 1,
|
||||||
'no_copy': 1,
|
"permlevel": 0
|
||||||
'oldfieldname': u'old_parent',
|
|
||||||
'oldfieldtype': u'Data',
|
|
||||||
'options': u'Customer Group',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,275 +1,222 @@
|
|||||||
# DocType, Sales Person
|
|
||||||
[
|
[
|
||||||
|
|
||||||
# These values are common in all dictionaries
|
|
||||||
{
|
{
|
||||||
'creation': '2012-07-03 13:30:54',
|
"owner": "Administrator",
|
||||||
'docstatus': 0,
|
"docstatus": 0,
|
||||||
'modified': '2012-07-12 10:33:10',
|
"creation": "2012-07-12 23:29:44",
|
||||||
'modified_by': u'Administrator',
|
"modified_by": "Administrator",
|
||||||
'owner': u'Administrator'
|
"modified": "2012-12-06 10:30:15"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
|
||||||
{
|
{
|
||||||
'_last_update': u'1302765705',
|
"autoname": "field:sales_person_name",
|
||||||
'allow_trash': 1,
|
"in_create": 1,
|
||||||
'autoname': u'field:sales_person_name',
|
"name": "__common__",
|
||||||
'colour': u'White:FFF',
|
"allow_rename": 1,
|
||||||
'description': u'All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.',
|
"search_fields": "name,parent_sales_person",
|
||||||
'doctype': 'DocType',
|
"module": "Setup",
|
||||||
'document_type': u'Master',
|
"doctype": "DocType",
|
||||||
'in_create': 1,
|
"document_type": "Master",
|
||||||
'module': u'Setup',
|
"description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets."
|
||||||
'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__",
|
||||||
'name': '__common__',
|
"parent": "Sales Person",
|
||||||
'parent': u'Sales Person',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"parenttype": "DocType",
|
||||||
'parenttype': u'DocType'
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"name": "__common__",
|
||||||
'doctype': u'DocPerm',
|
"parent": "Sales Person",
|
||||||
'name': '__common__',
|
"amend": 0,
|
||||||
'parent': u'Sales Person',
|
"submit": 0,
|
||||||
'parentfield': u'permissions',
|
"doctype": "DocPerm",
|
||||||
'parenttype': u'DocType',
|
"read": 1,
|
||||||
'read': 1,
|
"parenttype": "DocType",
|
||||||
'submit': 0
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Sales Person
|
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"name": "Sales Person",
|
||||||
'name': u'Sales Person'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Small Text",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Trash Reason",
|
||||||
'permlevel': 1,
|
"oldfieldname": "trash_reason",
|
||||||
'role': u'Sales Manager',
|
"fieldname": "trash_reason",
|
||||||
'write': 0
|
"fieldtype": "Small Text",
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Data",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Sales Person Name",
|
||||||
'permlevel': 0,
|
"oldfieldname": "sales_person_name",
|
||||||
'role': u'Sales Manager',
|
"fieldname": "sales_person_name",
|
||||||
'write': 0
|
"fieldtype": "Data",
|
||||||
|
"search_index": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"description": "Select company name first.",
|
||||||
'create': 0,
|
"oldfieldtype": "Link",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'permlevel': 1,
|
"doctype": "DocField",
|
||||||
'role': u'Sales User',
|
"label": "Parent Sales Person",
|
||||||
'write': 0
|
"oldfieldname": "parent_sales_person",
|
||||||
|
"permlevel": 0,
|
||||||
|
"trigger": "Client",
|
||||||
|
"fieldname": "parent_sales_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "Sales Person"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Select",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Has Child Node",
|
||||||
'permlevel': 0,
|
"oldfieldname": "is_group",
|
||||||
'role': u'Sales User',
|
"options": "\nYes\nNo",
|
||||||
'write': 0
|
"fieldname": "is_group",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
"doctype": "DocField",
|
||||||
'create': 1,
|
"fieldname": "cb0",
|
||||||
'doctype': u'DocPerm',
|
"fieldtype": "Column Break",
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'role': u'Sales Master Manager',
|
|
||||||
'write': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"doctype": "DocField",
|
||||||
'create': 0,
|
"label": "Employee",
|
||||||
'doctype': u'DocPerm',
|
"options": "Employee",
|
||||||
'permlevel': 1,
|
"fieldname": "employee",
|
||||||
'role': u'Sales Master Manager',
|
"fieldtype": "Link",
|
||||||
'write': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'trash_reason',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Small Text',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Trash Reason',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'trash_reason',
|
"label": "lft",
|
||||||
'oldfieldtype': u'Small Text',
|
"oldfieldname": "lft",
|
||||||
'permlevel': 1
|
"fieldname": "lft",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'sales_person_name',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Data',
|
"oldfieldtype": "Int",
|
||||||
'in_filter': 1,
|
"doctype": "DocField",
|
||||||
'label': u'Sales Person Name',
|
"label": "rgt",
|
||||||
'oldfieldname': u'sales_person_name',
|
"oldfieldname": "rgt",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "rgt",
|
||||||
'permlevel': 0,
|
"fieldtype": "Int",
|
||||||
'reqd': 1,
|
"search_index": 1,
|
||||||
'search_index': 0
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"print_hide": 1,
|
||||||
'description': u'Select company name first.',
|
"no_copy": 1,
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Data",
|
||||||
'fieldname': u'parent_sales_person',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Link',
|
"label": "old_parent",
|
||||||
'label': u'Parent Sales Person',
|
"oldfieldname": "old_parent",
|
||||||
'oldfieldname': u'parent_sales_person',
|
"fieldname": "old_parent",
|
||||||
'oldfieldtype': u'Link',
|
"fieldtype": "Data",
|
||||||
'options': u'Sales Person',
|
"hidden": 1,
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'reqd': 1,
|
|
||||||
'trigger': u'Client'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"description": "Set targets Item Group-wise for this Sales Person.",
|
||||||
'fieldname': u'is_group',
|
"oldfieldtype": "Section Break",
|
||||||
'fieldtype': u'Select',
|
"colour": "White:FFF",
|
||||||
'label': u'Has Child Node',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'is_group',
|
"label": "Sales Person Targets",
|
||||||
'oldfieldtype': u'Select',
|
"fieldname": "target_details_section_break",
|
||||||
'options': u'\nYes\nNo',
|
"fieldtype": "Section Break",
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'reqd': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Table",
|
||||||
'fieldname': u'cb0',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Column Break',
|
"label": "Target Details1",
|
||||||
'permlevel': 0
|
"oldfieldname": "target_details",
|
||||||
|
"options": "Target Detail",
|
||||||
|
"fieldname": "target_details",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"description": "Select Budget Distribution to unevenly distribute targets across months.",
|
||||||
'fieldname': u'employee',
|
"oldfieldtype": "Link",
|
||||||
'fieldtype': u'Link',
|
"colour": "White:FFF",
|
||||||
'label': u'Employee',
|
"doctype": "DocField",
|
||||||
'options': u'Employee',
|
"label": "Target Distribution",
|
||||||
'permlevel': 0
|
"oldfieldname": "distribution_id",
|
||||||
|
"options": "Budget Distribution",
|
||||||
|
"fieldname": "distribution_id",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"search_index": 0,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'lft',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"role": "Sales Manager",
|
||||||
'in_filter': 1,
|
"cancel": 0,
|
||||||
'label': u'lft',
|
"permlevel": 1
|
||||||
'no_copy': 1,
|
|
||||||
'oldfieldname': u'lft',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'rgt',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"role": "Sales Manager",
|
||||||
'in_filter': 1,
|
"cancel": 0,
|
||||||
'label': u'rgt',
|
"permlevel": 0
|
||||||
'no_copy': 1,
|
|
||||||
'oldfieldname': u'rgt',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'old_parent',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Data',
|
"write": 0,
|
||||||
'hidden': 1,
|
"role": "Sales User",
|
||||||
'label': u'old_parent',
|
"cancel": 0,
|
||||||
'no_copy': 1,
|
"permlevel": 1
|
||||||
'oldfieldname': u'old_parent',
|
|
||||||
'oldfieldtype': u'Data',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 0,
|
||||||
'description': u'Set targets Item Group-wise for this Sales Person.',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'target_details_section_break',
|
"role": "Sales User",
|
||||||
'fieldtype': u'Section Break',
|
"cancel": 0,
|
||||||
'label': u'Sales Person Targets',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Section Break',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'target_details',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Table',
|
"write": 1,
|
||||||
'label': u'Target Details1',
|
"role": "Sales Master Manager",
|
||||||
'oldfieldname': u'target_details',
|
"cancel": 1,
|
||||||
'oldfieldtype': u'Table',
|
"permlevel": 0
|
||||||
'options': u'Target Detail',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 0,
|
||||||
'description': u'Select Budget Distribution to unevenly distribute targets across months.',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'distribution_id',
|
"role": "Sales Master Manager",
|
||||||
'fieldtype': u'Link',
|
"cancel": 0,
|
||||||
'label': u'Target Distribution',
|
"permlevel": 1
|
||||||
'oldfieldname': u'distribution_id',
|
|
||||||
'oldfieldtype': u'Link',
|
|
||||||
'options': u'Budget Distribution',
|
|
||||||
'permlevel': 0,
|
|
||||||
'search_index': 0
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,127 +1,97 @@
|
|||||||
# DocType, Supplier Type
|
|
||||||
[
|
[
|
||||||
|
|
||||||
# These values are common in all dictionaries
|
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:36:25',
|
"owner": "Administrator",
|
||||||
'docstatus': 0,
|
"docstatus": 0,
|
||||||
'modified': '2012-03-27 14:36:25',
|
"creation": "2012-07-03 13:30:53",
|
||||||
'modified_by': u'Administrator',
|
"modified_by": "Administrator",
|
||||||
'owner': u'Administrator'
|
"modified": "2012-12-06 10:29:04"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
|
||||||
{
|
{
|
||||||
'allow_trash': 1,
|
"autoname": "field:supplier_type",
|
||||||
'autoname': u'field:supplier_type',
|
"name": "__common__",
|
||||||
'colour': u'White:FFF',
|
"allow_rename": 1,
|
||||||
'doctype': 'DocType',
|
"doctype": "DocType",
|
||||||
'document_type': u'Master',
|
"module": "Setup",
|
||||||
'module': u'Setup',
|
"document_type": "Master"
|
||||||
'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__",
|
||||||
'name': '__common__',
|
"parent": "Supplier Type",
|
||||||
'parent': u'Supplier Type',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"parenttype": "DocType",
|
||||||
'parenttype': u'DocType'
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"name": "__common__",
|
||||||
'doctype': u'DocPerm',
|
"parent": "Supplier Type",
|
||||||
'name': '__common__',
|
"amend": 0,
|
||||||
'parent': u'Supplier Type',
|
"doctype": "DocPerm",
|
||||||
'parentfield': u'permissions',
|
"submit": 0,
|
||||||
'parenttype': u'DocType',
|
"read": 1,
|
||||||
'read': 1,
|
"parenttype": "DocType",
|
||||||
'submit': 0
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Supplier Type
|
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"name": "Supplier Type",
|
||||||
'name': u'Supplier Type'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
"oldfieldtype": "Small Text",
|
||||||
'create': 1,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Trash Reason",
|
||||||
'permlevel': 0,
|
"oldfieldname": "trash_reason",
|
||||||
'role': u'Purchase Master Manager',
|
"fieldname": "trash_reason",
|
||||||
'write': 1
|
"fieldtype": "Small Text",
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Data",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Supplier Type",
|
||||||
'permlevel': 1,
|
"oldfieldname": "supplier_type",
|
||||||
'role': u'Purchase Manager',
|
"fieldname": "supplier_type",
|
||||||
'write': 0
|
"fieldtype": "Data",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"create": 0,
|
||||||
'create': 0,
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocPerm',
|
"write": 0,
|
||||||
'permlevel': 0,
|
"role": "Purchase Manager",
|
||||||
'role': u'Purchase Manager',
|
"cancel": 0,
|
||||||
'write': 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 User',
|
"cancel": 0,
|
||||||
'write': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"create": 0,
|
||||||
'create': 0,
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocPerm',
|
"write": 0,
|
||||||
'permlevel': 0,
|
"role": "Purchase User",
|
||||||
'role': u'Purchase User',
|
"cancel": 0,
|
||||||
'write': 0
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'trash_reason',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Small Text',
|
"write": 0,
|
||||||
'label': u'Trash Reason',
|
"role": "Purchase User",
|
||||||
'oldfieldname': u'trash_reason',
|
"cancel": 0,
|
||||||
'oldfieldtype': u'Small Text',
|
"permlevel": 0
|
||||||
'permlevel': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'supplier_type',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Data',
|
"write": 1,
|
||||||
'label': u'Supplier Type',
|
"role": "Purchase Master Manager",
|
||||||
'oldfieldname': u'supplier_type',
|
"cancel": 1,
|
||||||
'oldfieldtype': u'Data',
|
"permlevel": 0
|
||||||
'permlevel': 0,
|
|
||||||
'reqd': 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,286 +1,233 @@
|
|||||||
# DocType, Territory
|
|
||||||
[
|
[
|
||||||
|
|
||||||
# These values are common in all dictionaries
|
|
||||||
{
|
{
|
||||||
'creation': '2012-07-03 13:30:55',
|
"owner": "Administrator",
|
||||||
'docstatus': 0,
|
"docstatus": 0,
|
||||||
'modified': '2012-07-12 10:01:47',
|
"creation": "2012-07-12 23:29:44",
|
||||||
'modified_by': u'Administrator',
|
"modified_by": "Administrator",
|
||||||
'owner': u'Administrator'
|
"modified": "2012-12-06 10:29:39"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
|
||||||
{
|
{
|
||||||
'_last_update': u'1311621379',
|
"in_create": 1,
|
||||||
'allow_trash': 1,
|
"search_fields": "name,parent_territory,territory_manager",
|
||||||
'autoname': u'field:territory_name',
|
"module": "Setup",
|
||||||
'colour': u'White:FFF',
|
"document_type": "Master",
|
||||||
'default_print_format': u'Standard',
|
"description": "Classification of Customers by region",
|
||||||
'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.',
|
"read_only": 1,
|
||||||
'doctype': 'DocType',
|
"autoname": "field:territory_name",
|
||||||
'document_type': u'Master',
|
"name": "__common__",
|
||||||
'in_create': 1,
|
"default_print_format": "Standard",
|
||||||
'module': u'Setup',
|
"allow_rename": 1,
|
||||||
'name': '__common__',
|
"doctype": "DocType",
|
||||||
'name_case': u'Title Case',
|
"name_case": "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__",
|
||||||
'name': '__common__',
|
"parent": "Territory",
|
||||||
'parent': u'Territory',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"parenttype": "DocType",
|
||||||
'parenttype': u'DocType'
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"name": "__common__",
|
||||||
'doctype': u'DocPerm',
|
"parent": "Territory",
|
||||||
'name': '__common__',
|
"amend": 0,
|
||||||
'parent': u'Territory',
|
"submit": 0,
|
||||||
'parentfield': u'permissions',
|
"doctype": "DocPerm",
|
||||||
'parenttype': u'DocType',
|
"read": 1,
|
||||||
'read': 1,
|
"parenttype": "DocType",
|
||||||
'submit': 0
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Territory
|
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"name": "Territory",
|
||||||
'name': u'Territory'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Small Text",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Trash Reason",
|
||||||
'permlevel': 1,
|
"oldfieldname": "trash_reason",
|
||||||
'role': u'Sales Manager',
|
"fieldname": "trash_reason",
|
||||||
'write': 0
|
"fieldtype": "Small Text",
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"no_copy": 1,
|
||||||
'create': 0,
|
"oldfieldtype": "Data",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "Territory Name",
|
||||||
'role': u'Sales Manager',
|
"oldfieldname": "territory_name",
|
||||||
'write': 0
|
"fieldname": "territory_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"oldfieldtype": "Link",
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Parent Territory",
|
||||||
'permlevel': 1,
|
"oldfieldname": "parent_territory",
|
||||||
'role': u'Sales Master Manager',
|
"trigger": "Client",
|
||||||
'write': 0
|
"fieldname": "parent_territory",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "Territory",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
'create': 0,
|
"oldfieldtype": "Select",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'permlevel': 1,
|
"doctype": "DocField",
|
||||||
'role': u'Sales User',
|
"label": "Has Child Node",
|
||||||
'write': 0
|
"oldfieldname": "is_group",
|
||||||
|
"options": "\nYes\nNo",
|
||||||
|
"fieldname": "is_group",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"doctype": "DocField",
|
||||||
'create': 0,
|
"fieldname": "cb0",
|
||||||
'doctype': u'DocPerm',
|
"fieldtype": "Column Break",
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'role': u'Sales User',
|
|
||||||
'write': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
{
|
||||||
'cancel': 1,
|
"description": "For reference",
|
||||||
'create': 1,
|
"oldfieldtype": "Link",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'permlevel': 0,
|
"doctype": "DocField",
|
||||||
'role': u'Sales Master Manager',
|
"label": "Territory Manager",
|
||||||
'write': 1
|
"oldfieldname": "territory_manager",
|
||||||
|
"permlevel": 0,
|
||||||
|
"fieldname": "territory_manager",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"search_index": 1,
|
||||||
|
"in_filter": 1,
|
||||||
|
"options": "Sales Person"
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'trash_reason',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Small Text',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Trash Reason',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'trash_reason',
|
"label": "lft",
|
||||||
'oldfieldtype': u'Small Text',
|
"oldfieldname": "lft",
|
||||||
'permlevel': 1
|
"fieldname": "lft",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'territory_name',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Data',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Territory Name',
|
"doctype": "DocField",
|
||||||
'no_copy': 1,
|
"label": "rgt",
|
||||||
'oldfieldname': u'territory_name',
|
"oldfieldname": "rgt",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "rgt",
|
||||||
'permlevel': 0,
|
"fieldtype": "Int",
|
||||||
'reqd': 1
|
"search_index": 1,
|
||||||
|
"hidden": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"print_hide": 1,
|
||||||
'fieldname': u'parent_territory',
|
"no_copy": 1,
|
||||||
'fieldtype': u'Link',
|
"oldfieldtype": "Data",
|
||||||
'label': u'Parent Territory',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'parent_territory',
|
"label": "old_parent",
|
||||||
'oldfieldtype': u'Link',
|
"oldfieldname": "old_parent",
|
||||||
'options': u'Territory',
|
"permlevel": 0,
|
||||||
'permlevel': 0,
|
"fieldname": "old_parent",
|
||||||
'reqd': 1,
|
"fieldtype": "Link",
|
||||||
'trigger': u'Client'
|
"hidden": 1,
|
||||||
|
"options": "Territory",
|
||||||
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.",
|
||||||
'description': u'Only leaf nodes are allowed in transaction',
|
"oldfieldtype": "Section Break",
|
||||||
'doctype': u'DocField',
|
"colour": "White:FFF",
|
||||||
'fieldname': u'is_group',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Select',
|
"label": "Territory Targets",
|
||||||
'label': u'Has Child Node',
|
"fieldname": "target_details_section_break",
|
||||||
'oldfieldname': u'is_group',
|
"fieldtype": "Section Break",
|
||||||
'oldfieldtype': u'Select',
|
"permlevel": 0
|
||||||
'options': u'\nYes\nNo',
|
|
||||||
'permlevel': 0,
|
|
||||||
'reqd': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Table",
|
||||||
'fieldname': u'cb0',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Column Break',
|
"label": "Target Details",
|
||||||
'permlevel': 0
|
"oldfieldname": "target_details",
|
||||||
|
"options": "Target Detail",
|
||||||
|
"fieldname": "target_details",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"description": "Select Budget Distribution to unevenly distribute targets across months.",
|
||||||
'description': u'For reference',
|
"oldfieldtype": "Link",
|
||||||
'doctype': u'DocField',
|
"colour": "White:FFF",
|
||||||
'fieldname': u'territory_manager',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Link',
|
"label": "Target Distribution",
|
||||||
'in_filter': 1,
|
"oldfieldname": "distribution_id",
|
||||||
'label': u'Territory Manager',
|
"options": "Budget Distribution",
|
||||||
'oldfieldname': u'territory_manager',
|
"fieldname": "distribution_id",
|
||||||
'oldfieldtype': u'Link',
|
"fieldtype": "Link",
|
||||||
'options': u'Sales Person',
|
"permlevel": 0
|
||||||
'permlevel': 0,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'lft',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"cancel": 0,
|
||||||
'in_filter': 1,
|
"role": "Sales Manager",
|
||||||
'label': u'lft',
|
"permlevel": 1
|
||||||
'no_copy': 1,
|
|
||||||
'oldfieldname': u'lft',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 0,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'rgt',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"write": 0,
|
||||||
'hidden': 1,
|
"cancel": 0,
|
||||||
'in_filter': 1,
|
"role": "Sales Manager",
|
||||||
'label': u'rgt',
|
"permlevel": 0
|
||||||
'no_copy': 1,
|
|
||||||
'oldfieldname': u'rgt',
|
|
||||||
'oldfieldtype': u'Int',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 0,
|
|
||||||
'search_index': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'old_parent',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Link',
|
"write": 0,
|
||||||
'hidden': 1,
|
"cancel": 0,
|
||||||
'label': u'old_parent',
|
"role": "Sales Master Manager",
|
||||||
'no_copy': 1,
|
"permlevel": 1
|
||||||
'oldfieldname': u'old_parent',
|
|
||||||
'oldfieldtype': u'Data',
|
|
||||||
'options': u'Territory',
|
|
||||||
'permlevel': 0,
|
|
||||||
'print_hide': 1,
|
|
||||||
'report_hide': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 0,
|
||||||
'description': u'Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'target_details_section_break',
|
"cancel": 0,
|
||||||
'fieldtype': u'Section Break',
|
"role": "Sales User",
|
||||||
'label': u'Territory Targets',
|
"permlevel": 1
|
||||||
'oldfieldtype': u'Section Break',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'target_details',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Table',
|
"write": 0,
|
||||||
'label': u'Target Details',
|
"cancel": 0,
|
||||||
'oldfieldname': u'target_details',
|
"role": "Sales User",
|
||||||
'oldfieldtype': u'Table',
|
"permlevel": 0
|
||||||
'options': u'Target Detail',
|
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
"create": 1,
|
||||||
'description': u'Select Budget Distribution to unevenly distribute targets across months.',
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 1,
|
||||||
'fieldname': u'distribution_id',
|
"cancel": 1,
|
||||||
'fieldtype': u'Link',
|
"role": "Sales Master Manager",
|
||||||
'label': u'Target Distribution',
|
"permlevel": 0
|
||||||
'oldfieldname': u'distribution_id',
|
|
||||||
'oldfieldtype': u'Link',
|
|
||||||
'options': u'Budget Distribution',
|
|
||||||
'permlevel': 0
|
|
||||||
}
|
}
|
||||||
]
|
]
|
Loading…
Reference in New Issue
Block a user