mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
first cut for lazy loading framework
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
if(doc.abbr && !doc.__islocal) set_field_permlevel('abbr',1);
|
||||
}
|
||||
|
||||
cur_frm.cscript.has_special_chars = function(t) {
|
||||
var iChars = "!@#$%^*+=-[]\\\';,/{}|\":<>?";
|
||||
for (var i = 0; i < t.length; i++) {
|
||||
if (iChars.indexOf(t.charAt(i)) != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
cur_frm.cscript.company_name = function(doc){
|
||||
if(doc.company_name && cur_frm.cscript.has_special_chars(doc.company_name)){
|
||||
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nCompany Name <b>" + doc.company_name +"</b>")
|
||||
doc.company_name = '';
|
||||
refresh_field('company_name');
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.abbr = function(doc){
|
||||
if(doc.abbr && cur_frm.cscript.has_special_chars(doc.abbr)){
|
||||
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nAbbr <b>" + doc.abbr +"</b>")
|
||||
doc.abbr = '';
|
||||
refresh_field('abbr');
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.default_bank_account.get_query = function(doc) {
|
||||
return 'SELECT `tabAccount`.name, `tabAccount`.debit_or_credit, `tabAccount`.group_or_ledger FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Ledger" AND `tabAccount`.docstatus != 2 AND `tabAccount`.account_type = "Bank or Cash" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
|
||||
}
|
||||
|
||||
|
||||
cur_frm.fields_dict.receivables_group.get_query = function(doc) {
|
||||
return 'SELECT `tabAccount`.name FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Group" AND `tabAccount`.docstatus != 2 AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
|
||||
}
|
||||
|
||||
|
||||
cur_frm.fields_dict.payables_group.get_query = function(doc) {
|
||||
return 'SELECT `tabAccount`.name FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Group" AND `tabAccount`.docstatus != 2 AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
# Create default accounts
|
||||
# ---------------------------------------------------
|
||||
def create_default_accounts(self):
|
||||
self.fld_dict = {'account_name':0,'parent_account':1,'group_or_ledger':2,'is_pl_account':3,'account_type':4,'debit_or_credit':5,'company':6,'tax_rate':7}
|
||||
acc_list_common = [['Application of Funds (Assets)','','Group','No','','Debit',self.doc.name,''],
|
||||
['Current Assets','Application of Funds (Assets)','Group','No','','Debit',self.doc.name,''],
|
||||
['Accounts Receivable','Current Assets','Group','No','','Debit',self.doc.name,''],
|
||||
['Bank Accounts','Current Assets','Group','No','Bank or Cash','Debit',self.doc.name,''],
|
||||
['Cash In Hand','Current Assets','Group','No','Bank or Cash','Debit',self.doc.name,''],
|
||||
['Cash','Cash In Hand','Ledger','No','Bank or Cash','Debit',self.doc.name,''],
|
||||
['Loans and Advances (Assets)','Current Assets','Group','No','','Debit',self.doc.name,''],
|
||||
['Securities and Deposits','Current Assets','Group','No','','Debit',self.doc.name,''],
|
||||
['Earnest Money','Securities and Deposits','Ledger','No','','Debit',self.doc.name,''],
|
||||
['Stock In Hand','Current Assets','Group','No','','Debit',self.doc.name,''],
|
||||
['Stock','Stock In Hand','Ledger','No','','Debit',self.doc.name,''],
|
||||
['Tax Assets','Current Assets','Group','No','','Debit',self.doc.name,''],
|
||||
['Fixed Assets','Application of Funds (Assets)','Group','No','','Debit',self.doc.name,''],
|
||||
['Capital Equipments','Fixed Assets','Ledger','No','Fixed Asset Account','Debit',self.doc.name,''],
|
||||
['Computers','Fixed Assets','Ledger','No','Fixed Asset Account','Debit',self.doc.name,''],
|
||||
['Furniture and Fixture','Fixed Assets','Ledger','No','Fixed Asset Account','Debit',self.doc.name,''],
|
||||
['Office Equipments','Fixed Assets','Ledger','No','Fixed Asset Account','Debit',self.doc.name,''],
|
||||
['Plant and Machinery','Fixed Assets','Ledger','No','Fixed Asset Account','Debit',self.doc.name,''],
|
||||
['Investments','Application of Funds (Assets)','Group','No','','Debit',self.doc.name,''],
|
||||
['Temporary Accounts (Assets)','Application of Funds (Assets)','Group','No','','Debit',self.doc.name,''],
|
||||
['Temporary Account (Assets)','Temporary Accounts (Assets)','Ledger','No','','Debit',self.doc.name,''],
|
||||
['Source of Funds (Liabilities)','','Group','No','','Credit',self.doc.name,''],
|
||||
['Capital Account','Source of Funds (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Reserves and Surplus','Capital Account','Group','No','','Credit',self.doc.name,''],
|
||||
['Shareholders Funds','Capital Account','Group','No','','Credit',self.doc.name,''],
|
||||
['Current Liabilities','Source of Funds (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Accounts Payable','Current Liabilities','Group','No','','Credit',self.doc.name,''],
|
||||
['Duties and Taxes','Current Liabilities','Group','No','','Credit',self.doc.name,''],
|
||||
['Loans (Liabilities)','Current Liabilities','Group','No','','Credit',self.doc.name,''],
|
||||
['Secured Loans','Loans (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Unsecured Loans','Loans (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Bank Overdraft Account','Loans (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Temporary Accounts (Liabilities)','Source of Funds (Liabilities)','Group','No','','Credit',self.doc.name,''],
|
||||
['Temporary Account (Liabilities)','Temporary Accounts (Liabilities)','Ledger','No','','Credit',self.doc.name,''],
|
||||
['Income','','Group','Yes','','Credit',self.doc.name,''],
|
||||
['Direct Income','Income','Group','Yes','Income Account','Credit',self.doc.name,''],
|
||||
['Sales','Direct Income','Ledger','Yes','Income Account','Credit',self.doc.name,''],
|
||||
['Service','Direct Income','Ledger','Yes','Income Account','Credit',self.doc.name,''],
|
||||
['Indirect Income','Income','Group','Yes','Income Account','Credit',self.doc.name,''],
|
||||
['Expenses','','Group','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Direct Expenses','Expenses','Group','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Cost of Goods Sold','Direct Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Indirect Expenses','Expenses','Group','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Advertising and Publicity','Indirect Expenses','Ledger','Yes','Chargeable','Debit',self.doc.name,''],
|
||||
['Bad Debts Written Off','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Bank Charges','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Books and Periodicals','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Charity and Donations','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Commission on Sales','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Conveyance Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Customer Entertainment Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Depreciation Account','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Freight and Forwarding Charges','Indirect Expenses','Ledger','Yes','Chargeable','Debit',self.doc.name,''],
|
||||
['Legal Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Miscellaneous Expenses','Indirect Expenses','Ledger','Yes','Chargeable','Debit',self.doc.name,''],
|
||||
['Office Maintenance Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Office Rent','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Postal Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Print and Stationary','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Rounded Off','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Salary','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Sales Promotion Expenses','Indirect Expenses','Ledger','Yes','Chargeable','Debit',self.doc.name,''],
|
||||
['Service Charges Paid','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Staff Welfare Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Telephone Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Travelling Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,''],
|
||||
['Water and Electricity Expenses','Indirect Expenses','Ledger','Yes','Expense Account','Debit',self.doc.name,'']
|
||||
]
|
||||
|
||||
acc_list_india = [
|
||||
['CENVAT Capital Goods','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['CENVAT','Tax Assets','Ledger','No','Chargeable','Debit',self.doc.name,''],
|
||||
['CENVAT Service Tax','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['CENVAT Service Tax Cess 1','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['CENVAT Service Tax Cess 2','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['CENVAT Edu Cess','Tax Assets','Ledger','No','Chargeable','Debit',self.doc.name,''],
|
||||
['CENVAT SHE Cess','Tax Assets','Ledger','No','Chargeable','Debit',self.doc.name,''],
|
||||
['Excise Duty 4','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'4.00'],
|
||||
['Excise Duty 8','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'8.00'],
|
||||
['Excise Duty 10','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'10.00'],
|
||||
['Excise Duty 14','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'14.00'],
|
||||
['Excise Duty Edu Cess 2','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'2.00'],
|
||||
['Excise Duty SHE Cess 1','Tax Assets','Ledger','No','Tax','Debit',self.doc.name,'1.00'],
|
||||
['P L A','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['P L A - Cess Portion','Tax Assets','Ledger','No','','Debit',self.doc.name,''],
|
||||
['Edu. Cess on Excise','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'2.00'],
|
||||
['Edu. Cess on Service Tax','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'2.00'],
|
||||
['Edu. Cess on TDS','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'2.00'],
|
||||
['Excise Duty @ 4','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'4.00'],
|
||||
['Excise Duty @ 8','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'8.00'],
|
||||
['Excise Duty @ 10','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'10.00'],
|
||||
['Excise Duty @ 14','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'14.00'],
|
||||
['Service Tax','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'10.3'],
|
||||
['SHE Cess on Excise','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'1.00'],
|
||||
['SHE Cess on Service Tax','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'1.00'],
|
||||
['SHE Cess on TDS','Duties and Taxes','Ledger','No','Tax','Credit',self.doc.name,'1.00'],
|
||||
['Professional Tax','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['VAT','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Advertisement)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Commission)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Contractor)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Interest)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Rent)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,''],
|
||||
['TDS (Salary)','Duties and Taxes','Ledger','No','','Credit',self.doc.name,'']
|
||||
]
|
||||
# load common account heads
|
||||
for d in acc_list_common:
|
||||
self.add_acc(d)
|
||||
|
||||
country = sql("select value from tabSingles where field = 'country' and doctype = 'Control Panel'")
|
||||
country = country and cstr(country[0][0]) or ''
|
||||
|
||||
# load taxes (only for India)
|
||||
if country == 'India':
|
||||
for d in acc_list_india:
|
||||
self.add_acc(d)
|
||||
|
||||
# Create account
|
||||
# ---------------------------------------------------
|
||||
def add_acc(self,lst):
|
||||
ac = Document('Account')
|
||||
for d in self.fld_dict.keys():
|
||||
ac.fields[d] = (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.doc.abbr or lst[self.fld_dict[d]]
|
||||
ac.old_parent = ''
|
||||
ac_obj = get_obj(doc=ac)
|
||||
ac_obj.validate()
|
||||
ac_obj.doc.save(1)
|
||||
ac_obj.on_update()
|
||||
sql("commit")
|
||||
sql("start transaction")
|
||||
|
||||
|
||||
# Set letter head
|
||||
# ---------------------------------------------------
|
||||
def set_letter_head(self):
|
||||
if not self.doc.letter_head:
|
||||
if self.doc.address:
|
||||
header = """
|
||||
<div><h3> %(comp)s </h3> %(add)s </div>
|
||||
|
||||
""" % {'comp':self.doc.name,
|
||||
'add':self.doc.address.replace("\n",'<br>')}
|
||||
|
||||
self.doc.letter_head = header
|
||||
|
||||
# Set default AR and AP group
|
||||
# ---------------------------------------------------
|
||||
def set_default_groups(self):
|
||||
if not self.doc.receivables_group:
|
||||
set(self.doc, 'receivables_group', 'Accounts Receivable - '+self.doc.abbr)
|
||||
if not self.doc.payables_group:
|
||||
set(self.doc, 'payables_group', 'Accounts Payable - '+self.doc.abbr)
|
||||
|
||||
|
||||
# Create default cost center
|
||||
# ---------------------------------------------------
|
||||
def create_default_cost_center(self):
|
||||
glc = get_obj('GL Control')
|
||||
cc_list = [{'cost_center_name':'Root','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Group','parent_cost_center':'','old_parent':''}, {'cost_center_name':'Default CC Ledger','company_name':self.doc.name,'company_abbr':self.doc.abbr,'group_or_ledger':'Ledger','parent_cost_center':'Root - ' + self.doc.abbr,'old_parent':''}]
|
||||
for c in cc_list:
|
||||
glc.add_cc(str(c))
|
||||
|
||||
|
||||
# On update
|
||||
# ---------------------------------------------------
|
||||
def on_update(self):
|
||||
self.set_letter_head()
|
||||
ac = sql("select name from tabAccount where account_name='Income' and company=%s", self.doc.name)
|
||||
if not ac:
|
||||
self.create_default_accounts()
|
||||
self.set_default_groups()
|
||||
cc = sql("select name from `tabCost Center` where cost_center_name = 'Root' and company_name = '%s'"%(self.doc.name))
|
||||
if not cc:
|
||||
self.create_default_cost_center()
|
||||
|
||||
# Trash accounts and cost centers for this company
|
||||
# ---------------------------------------------------
|
||||
#def on_trash1(self):
|
||||
# acc = sql("select name from tabAccount where company = '%s' and docstatus != 2 order by lft desc, rgt desc limit 2" % self.doc.name, debug=1)
|
||||
# for each in acc:
|
||||
# get_obj('Account', each[0]).on_trash()
|
||||
|
||||
# cc = sql("select name from `tabCost Center` where company_name = '%s' and docstatus != 2" % self.doc.name)
|
||||
# for each in cc:
|
||||
# get_obj('Cost Center', each[0]).on_trash()
|
||||
|
||||
# msgprint("Company trashed. All the accounts and cost centers related to this company also trashed. You can restore it anytime from Setup -> Manage Trash")
|
||||
|
||||
def on_trash(self):
|
||||
rec = sql("SELECT sum(ab.opening), sum(ab.balance), sum(ab.debit), sum(ab.credit) FROM `tabAccount Balance` ab, `tabAccount` a WHERE ab.account = a.name and a.company = %s", self.doc.name)
|
||||
if rec[0][0] == 0 and rec[0][1] == 0 and rec[0][2] == 0 and rec[0][3] == 0:
|
||||
#delete tabAccount Balance
|
||||
sql("delete ab.* from `tabAccount Balance` ab, `tabAccount` a where ab.account = a.name and a.company = %s", self.doc.name)
|
||||
#delete tabAccount
|
||||
sql("delete from `tabAccount` where company = %s order by lft desc, rgt desc", self.doc.name)
|
||||
|
||||
#delete cost center child table - budget detail
|
||||
sql("delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc where bd.parent = cc.name and cc.company_name = %s", self.doc.name)
|
||||
#delete cost center
|
||||
sql("delete from `tabCost Center` WHERE company_name = %s order by lft desc, rgt desc", self.doc.name)
|
||||
|
||||
#update value as blank for tabDefaultValue defkey=company
|
||||
sql("update `tabDefaultValue` set defvalue = '' where defkey='company' and defvalue = %s", self.doc.name)
|
||||
|
||||
#update value as blank for tabSingles Manage Account
|
||||
sql("update `tabSingles` set value = '' where doctype='Manage Account' and field = 'default_company' and value = %s", self.doc.name)
|
||||
|
||||
# Restore accounts and cost centers for this company
|
||||
# ---------------------------------------------------
|
||||
def on_restore(self):
|
||||
acc = sql("select name from tabAccount where company = '%s' and docstatus = 2" % self.doc.name)
|
||||
for each in acc:
|
||||
get_obj('Account', each[0]).on_restore()
|
||||
|
||||
cc = sql("select name from `tabCost Center` where company_name = '%s' and docstatus = 2" % self.doc.name)
|
||||
for each in cc:
|
||||
get_obj('Cost Center', each[0]).on_restore()
|
||||
|
||||
msgprint("Company restored. All the accounts and cost centers related to this company also restored.")
|
||||
|
||||
# on rename
|
||||
# ---------
|
||||
def on_rename(self,newdn,olddn):
|
||||
sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn))
|
||||
@@ -1,377 +0,0 @@
|
||||
# DocType, Company
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-08-08 17:08:55',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-01 17:43:29',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1309506817',
|
||||
'allow_trash': 1,
|
||||
'autoname': 'field:company_name',
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
'document_type': 'Master',
|
||||
'module': 'Setup',
|
||||
'name': '__common__',
|
||||
'section_style': 'Tabbed',
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 93
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'name': '__common__',
|
||||
'parent': 'Company',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': 'Company',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Company
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': 'Company'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 1,
|
||||
'permlevel': 0,
|
||||
'role': 'System Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 2,
|
||||
'permlevel': 0,
|
||||
'role': 'System Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 3,
|
||||
'permlevel': 1,
|
||||
'role': 'All'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'description': 'Please Enter Company Name and Abbr and save the document. Once saved Accounting Settings will be populated automatically',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 1,
|
||||
'label': 'Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'company_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 2,
|
||||
'label': 'Company',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'company_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'abbr',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 3,
|
||||
'label': 'Abbr',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'abbr',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'address',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 4,
|
||||
'label': 'Address',
|
||||
'oldfieldname': 'address',
|
||||
'oldfieldtype': 'Small Text',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'default_currency',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 5,
|
||||
'label': 'Default Currency',
|
||||
'options': 'link:Currency',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 6,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'phone_no',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 7,
|
||||
'label': 'Phone No',
|
||||
'oldfieldname': 'phone_no',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': 'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'email',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 8,
|
||||
'label': 'Email',
|
||||
'oldfieldname': 'email',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': 'Email',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'fax',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 9,
|
||||
'label': 'Fax',
|
||||
'oldfieldname': 'fax',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': 'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'website',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 10,
|
||||
'label': 'Website',
|
||||
'oldfieldname': 'website',
|
||||
'oldfieldtype': 'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Company registration numbers for your reference. Example: VAT Registration Numbers etc.',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 11,
|
||||
'label': 'Registration Info',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Company registration numbers for your reference. Tax numbers etc.',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'registration_details',
|
||||
'fieldtype': 'Code',
|
||||
'idx': 12,
|
||||
'label': 'Registration Details',
|
||||
'oldfieldname': 'registration_details',
|
||||
'oldfieldtype': 'Code',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 13,
|
||||
'label': 'Accounting Settings',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'default_bank_account',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 14,
|
||||
'label': 'Default Bank Account',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'default_bank_account',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': 'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'receivables_group',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 15,
|
||||
'label': 'Receivables Group',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'receivables_group',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': 'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'payables_group',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 16,
|
||||
'label': 'Payables Group',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'payables_group',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': 'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 17,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'yearly_bgt_flag',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 18,
|
||||
'label': 'If Yearly Budget Exceeded',
|
||||
'oldfieldname': 'yearly_bgt_flag',
|
||||
'oldfieldtype': 'Select',
|
||||
'options': '\nWarn\nIgnore\nStop',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'monthly_bgt_flag',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 19,
|
||||
'label': 'If Monthly Budget Exceeded',
|
||||
'oldfieldname': 'monthly_bgt_flag',
|
||||
'oldfieldtype': 'Select',
|
||||
'options': '\nWarn\nIgnore\nStop',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'credit_days',
|
||||
'fieldtype': 'Int',
|
||||
'idx': 20,
|
||||
'label': 'Credit Days',
|
||||
'oldfieldname': 'credit_days',
|
||||
'oldfieldtype': 'Int',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'credit_limit',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 21,
|
||||
'label': 'Credit Limit',
|
||||
'oldfieldname': 'credit_limit',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'trash_reason',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 22,
|
||||
'label': 'Trash Reason',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'trash_reason',
|
||||
'oldfieldtype': 'Small Text',
|
||||
'permlevel': 1
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user