first cut for lazy loading framework

This commit is contained in:
Rushabh Mehta
2011-09-05 18:43:09 +05:30
parent 09938bda69
commit 66ac2b018a
1512 changed files with 832 additions and 0 deletions

View File

@@ -1,79 +0,0 @@
// Fetch parent details
// -----------------------------------------
cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit');
cur_frm.add_fetch('parent_account', 'is_pl_account', 'is_pl_account');
// Hide tax rate based on account type
// -----------------------------------------
cur_frm.cscript.account_type = function(doc, cdt, cdn) {
if(doc.account_type == 'Tax') unhide_field(['tax_rate']);
else hide_field(['tax_rate']);
}
// Onload
// -----------------------------------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.account_type(doc, cdt, cdn);
// hide India specific fields
var cp = locals['Control Panel']['Control Panel'];
if(cp.country == 'India')
unhide_field(['pan_number', 'tds_applicable', 'tds_details', 'TDS']);
else
hide_field(['pan_number', 'tds_applicable', 'tds_details', 'TDS']);
}
// Refresh
// -----------------------------------------
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
root_acc = [' Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)'];
if(inList(root_acc, doc.account_name))
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.cscript.hide_unhide_group_ledger(doc);
}
// Hide/unhide group or ledger
// -----------------------------------------
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
hide_field(['Convert to Group', 'Convert to Ledger']);
if (cstr(doc.group_or_ledger) == 'Group') unhide_field('Convert to Ledger');
else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('Convert to Group');
}
// Convert group to ledger
// -----------------------------------------
cur_frm.cscript['Convert to Ledger'] = function(doc, cdt, cdn) {
$c_obj(make_doclist(cdt,cdn),'convert_group_to_ledger','',function(r,rt) {
if(r.message == 1) {
doc.group_or_ledger = 'Ledger';
refresh_field('group_or_ledger');
cur_frm.cscript.hide_unhide_group_ledger(doc);
}
});
}
// Convert ledger to group
// -----------------------------------------
cur_frm.cscript['Convert to Group'] = function(doc, cdt, cdn) {
$c_obj(make_doclist(cdt,cdn),'convert_ledger_to_group','',function(r,rt) {
if(r.message == 1) {
doc.group_or_ledger = 'Group';
refresh_field('group_or_ledger');
cur_frm.cscript.hide_unhide_group_ledger(doc);
}
});
}
// Master name get query
// -----------------------------------------
cur_frm.fields_dict['master_name'].get_query=function(doc){
if (doc.master_type){
return 'SELECT `tab'+doc.master_type+'`.name FROM `tab'+doc.master_type+'` WHERE `tab'+doc.master_type+'`.name LIKE "%s" and `tab'+doc.master_type+'`.docstatus != 2 ORDER BY `tab'+doc.master_type+'`.name LIMIT 50';
}
else alert("Please select master type");
}
// parent account get query
// -----------------------------------------
cur_frm.fields_dict['parent_account'].get_query = function(doc){
return 'SELECT DISTINCT `tabAccount`.name FROM `tabAccount` WHERE `tabAccount`.group_or_ledger="Group" AND `tabAccount`.docstatus != 2 AND `tabAccount`.company="'+ doc.company+'" AND `tabAccount`.company is not NULL AND `tabAccount`.name LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
}

View File

@@ -1,275 +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
self.nsm_parent_field = 'parent_account'
def autoname(self):
company_abbr = sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0]
self.doc.name = self.doc.account_name.strip() + ' - ' + company_abbr
# Get customer/supplier address
# ==================================================================
def get_address(self):
add=sql("Select address from `tab%s` where name='%s'"%(self.doc.master_type,self.doc.master_name))
ret={'address':add[0][0]}
return ret
# check whether master name entered for supplier/customer
# ==================================================================
def validate_master_name(self):
if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') and not self.doc.master_name:
msgprint("Message: Please enter Master Name once the account is created.")
# Rate is mandatory for tax account
# ==================================================================
def validate_rate_for_tax(self):
if self.doc.account_type == 'Tax' and not self.doc.tax_rate:
msgprint("Please Enter Rate", raise_exception=1)
# Fetch Parent Details and validation for account not to be created under ledger
# ==================================================================
def validate_parent(self):
if self.doc.parent_account:
par = sql("select name, group_or_ledger, is_pl_account, debit_or_credit from tabAccount where name =%s",self.doc.parent_account)
if not par:
msgprint("Parent account does not exists", raise_exception=1)
elif par and par[0][0] == self.doc.name:
msgprint("You can not assign itself as parent account", raise_exception=1)
elif par and par[0][1] != 'Group':
msgprint("Parent account can not be a ledger", raise_exception=1)
elif par and self.doc.debit_or_credit and par[0][3] != self.doc.debit_or_credit:
msgprint("You can not move a %s account under %s account" % (self.doc.debit_or_credit, par[0][3]), raise_exception=1)
elif par and not self.doc.is_pl_account:
self.doc.is_pl_account = par[0][2]
self.doc.debit_or_credit = par[0][3]
# Account name must be unique
# ==================================================================
def validate_duplicate_account(self):
if (self.doc.__islocal or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
msgprint("Account Name already exists, please rename", raise_exception=1)
# validate root details
# ==================================================================
def validate_root_details(self):
#does not exists parent
if self.doc.account_name in ['Income','Source of Funds', 'Expenses','Application of Funds'] and self.doc.parent_account:
msgprint("You can not assign parent for root account", raise_exception=1)
# Debit / Credit
if self.doc.account_name in ['Income','Source of Funds']:
self.doc.debit_or_credit = 'Credit'
elif self.doc.account_name in ['Expenses','Application of Funds']:
self.doc.debit_or_credit = 'Debit'
# Is PL Account
if self.doc.account_name in ['Income','Expenses']:
self.doc.is_pl_account = 'Yes'
elif self.doc.account_name in ['Source of Funds','Application of Funds']:
self.doc.is_pl_account = 'No'
# Convert group to ledger
# ==================================================================
def convert_group_to_ledger(self):
if self.check_if_child_exists():
msgprint("Account: %s has existing child. You can not convert this account to ledger" % (self.doc.name), raise_exception=1)
elif self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to ledger.", raise_exception=1)
else:
self.doc.group_or_ledger = 'Ledger'
self.doc.save()
return 1
# Convert ledger to group
# ==================================================================
def convert_ledger_to_group(self):
if self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to group.", raise_exception=1)
else:
self.doc.group_or_ledger = 'Group'
self.doc.save()
return 1
# Check if any previous balance exists
# ==================================================================
def check_gle_exists(self):
exists = sql("select name from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No'" % (self.doc.name))
return exists and exists[0][0] or ''
# check if child exists
# ==================================================================
def check_if_child_exists(self):
return sql("select name from `tabAccount` where parent_account = %s and docstatus != 2", self.doc.name, debug=0)
# Update balance
# ==================================================================
def update_balance(self, fy, period_det, flag = 1):
# update in all parents
for p in period_det:
sql("update `tabAccount Balance` t1, `tabAccount` t2 set t1.balance = t1.balance + (%s), t1.opening = t1.opening + (%s), t1.debit = t1.debit + (%s), t1.credit = t1.credit + (%s) where t1.period = %s and t1.account = t2.name and t2.lft<=%s and t2.rgt>=%s", (flt(flag)*flt(p[1]), flt(flag)*flt(p[2]), flt(flag)*flt(p[3]), flt(flag)*flt(p[4]), p[0], self.doc.lft, self.doc.rgt))
# change parent balance
# ==================================================================
def change_parent_bal(self):
period_det = []
fy = sql("select name from `tabFiscal Year` where if(ifnull(is_fiscal_year_closed, 'No'),ifnull(is_fiscal_year_closed, 'No'), 'No') = 'No'")
for f in fy:
# get my opening, balance
per = sql("select period, balance, opening, debit, credit from `tabAccount Balance` where account = %s and fiscal_year = %s", (self.doc.name, f[0]))
for p in per:
period_det.append([p[0], p[1], p[2], p[3], p[4]])
# deduct balance from old_parent
op = get_obj('Account',self.doc.old_parent)
op.update_balance(fy, period_det, -1)
# add to new parent_account
flag = 1
if op.doc.debit_or_credit != self.doc.debit_or_credit:
flag = -1
get_obj('Account', self.doc.parent_account).update_balance(fy, period_det, flag)
msgprint('Balances updated')
# VALIDATE
# ==================================================================
def validate(self):
self.validate_master_name()
self.validate_rate_for_tax()
self.validate_parent()
self.validate_duplicate_account()
self.validate_root_details()
# Defaults
if not self.doc.parent_account:
self.doc.parent_account = ''
# parent changed
if self.doc.old_parent and self.doc.parent_account and (self.doc.parent_account != self.doc.old_parent):
self.change_parent_bal()
# Add current fiscal year balance
# ==================================================================
def set_year_balance(self):
p = sql("select name, start_date, end_date, fiscal_year from `tabPeriod` where docstatus != 2 and period_type in ('Month', 'Year')")
for d in p:
if not sql("select name from `tabAccount Balance` where account=%s and period=%s", (self.doc.name, d[0])):
ac = Document('Account Balance')
ac.account = self.doc.name
ac.period = d[0]
ac.start_date = d[1].strftime('%Y-%m-%d')
ac.end_date = d[2].strftime('%Y-%m-%d')
ac.fiscal_year = d[3]
ac.opening = 0
ac.debit = 0
ac.credit = 0
ac.balance = 0
ac.save(1)
# Update Node Set Model
# ==================================================================
def update_nsm_model(self):
import webnotes
import webnotes.utils.nestedset
webnotes.utils.nestedset.update_nsm(self)
# ON UPDATE
# ==================================================================
def on_update(self):
# update nsm
self.update_nsm_model()
# Add curret year balance
self.set_year_balance()
# Check user role for approval process
# ==================================================================
def get_authorized_user(self):
# Check logged-in user is authorized
if get_value('Manage Account', None, 'credit_controller') in webnotes.user.get_roles():
return 1
# Check Credit limit for customer
# ==================================================================
def check_credit_limit(self, account, company, tot_outstanding):
# Get credit limit
credit_limit_from = 'Customer'
cr_limit = sql("select t1.credit_limit from tabCustomer t1, `tabAccount` t2 where t2.name='%s' and t1.name = t2.master_name" % account)
credit_limit = cr_limit and flt(cr_limit[0][0]) or 0
if not credit_limit:
credit_limit = get_value('Company', company, 'credit_limit')
credit_limit_from = 'global settings in the Company'
# If outstanding greater than credit limit and not authorized person raise exception
if credit_limit > 0 and flt(tot_outstanding) > credit_limit and not self.get_authorized_user():
msgprint("Total Outstanding amount (%s) for <b>%s</b> can not be greater than credit limit (%s). To change your credit limit settings, please update the <b>%s</b>" \
% (fmt_money(tot_outstanding), account, fmt_money(credit_limit), credit_limit_from), raise_exception=1)
# Account with balance cannot be inactive
# ==================================================================
def check_balance_before_trash(self):
if self.check_gle_exists():
msgprint("Account with existing transaction can not be trashed", raise_exception=1)
if self.check_if_child_exists():
msgprint("Child account exists for this account. You can not trash this account.", raise_exception=1)
# get current year balance
# ==================================================================
def get_curr_bal(self):
bal = sql("select balance from `tabAccount Balance` where period = '%s' and parent = '%s'" % (get_defaults()['fiscal_year'], self.doc.name),debug=0)
return bal and flt(bal[0][0]) or 0
# On Trash
# ==================================================================
def on_trash(self):
# Check balance before trash
self.check_balance_before_trash()
# rebuild tree
set(self.doc,'old_parent', '')
self.update_nsm_model()
#delete Account Balance
sql("delete from `tabAccount Balance` where account = %s", self.doc.name)
# On restore
# ==================================================================
def on_restore(self):
# rebuild tree
self.update_nsm_model()
# on rename
# ---------
def on_rename(self,newdn,olddn):
company_abbr = sql("select tc.abbr from `tabAccount` ta, `tabCompany` tc where ta.company = tc.name and ta.name=%s", olddn)[0][0]
newdnchk = newdn.split(" - ")
if newdnchk[-1].lower() != company_abbr.lower():
msgprint("Please add company abbreviation <b>%s</b>" %(company_abbr), raise_exception=1)
else:
account_name = " - ".join(newdnchk[:-1])
sql("update `tabAccount` set account_name = '%s' where name = '%s'" %(account_name,olddn))

View File

@@ -1,521 +0,0 @@
# DocType, Account
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:08:51',
'docstatus': 0,
'modified': '2011-06-23 17:11:38',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1309508836',
'allow_copy': 1,
'allow_trash': 1,
'colour': 'White:FFF',
'doctype': 'DocType',
'document_type': 'Master',
'in_create': 1,
'module': 'Accounts',
'name': '__common__',
'search_fields': 'debit_or_credit, group_or_ledger',
'section_style': 'Tray',
'server_code_error': ' ',
'show_in_menu': 0,
'version': 133
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Account',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Account',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1
},
# DocType, Account
{
'doctype': 'DocType',
'name': 'Account'
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0,
'role': 'Sales User'
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 0,
'role': 'Purchase User'
},
# DocPerm
{
'amend': 0,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 3,
'permlevel': 0,
'role': 'Accounts User',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0,
'role': 'Accounts Manager',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 5,
'permlevel': 1,
'role': 'Accounts User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 6,
'permlevel': 1,
'role': 'Accounts Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 7,
'permlevel': 2,
'role': 'Accounts Manager',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 8,
'permlevel': 2,
'role': 'Accounts User',
'submit': 0,
'write': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 1,
'label': 'Properties',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 2,
'permlevel': 0,
'width': '50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'account_name',
'fieldtype': 'Data',
'idx': 3,
'in_filter': 1,
'label': 'Account Name',
'no_copy': 1,
'oldfieldname': 'account_name',
'oldfieldtype': 'Data',
'permlevel': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'parent_account',
'fieldtype': 'Link',
'idx': 4,
'label': 'Parent Account',
'oldfieldname': 'parent_account',
'oldfieldtype': 'Link',
'options': 'Account',
'permlevel': 0,
'search_index': 1,
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'level',
'fieldtype': 'Int',
'hidden': 1,
'idx': 5,
'label': 'Level',
'oldfieldname': 'level',
'oldfieldtype': 'Int',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'default': 'Ledger',
'doctype': 'DocField',
'fieldname': 'group_or_ledger',
'fieldtype': 'Select',
'idx': 6,
'in_filter': 1,
'label': 'Group or Ledger',
'oldfieldname': 'group_or_ledger',
'oldfieldtype': 'Select',
'options': '\nLedger\nGroup',
'permlevel': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 7,
'label': 'Convert to Group',
'permlevel': 0,
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 8,
'label': 'Convert to Ledger',
'permlevel': 0,
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'debit_or_credit',
'fieldtype': 'Data',
'idx': 9,
'in_filter': 1,
'label': 'Debit or Credit',
'oldfieldname': 'debit_or_credit',
'oldfieldtype': 'Data',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'is_pl_account',
'fieldtype': 'Select',
'idx': 10,
'in_filter': 1,
'label': 'Is PL Account',
'oldfieldname': 'is_pl_account',
'oldfieldtype': 'Select',
'options': 'Yes\nNo',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'account_type',
'fieldtype': 'Select',
'idx': 11,
'in_filter': 1,
'label': 'Account Type',
'oldfieldname': 'account_type',
'oldfieldtype': 'Select',
'options': '\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable',
'permlevel': 0,
'search_index': 0,
'trigger': 'Client'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If Account Type is "Tax" then the default rate is required.',
'doctype': 'DocField',
'fieldname': 'tax_rate',
'fieldtype': 'Currency',
'hidden': 0,
'idx': 12,
'label': 'Rate',
'oldfieldname': 'tax_rate',
'oldfieldtype': 'Currency',
'permlevel': 0,
'reqd': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 13,
'permlevel': 0,
'width': '50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'freeze_account',
'fieldtype': 'Select',
'idx': 14,
'label': 'Freeze Account',
'oldfieldname': 'freeze_account',
'oldfieldtype': 'Select',
'options': 'No\nYes',
'permlevel': 2
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'company',
'fieldtype': 'Link',
'idx': 15,
'in_filter': 1,
'label': 'Company',
'oldfieldname': 'company',
'oldfieldtype': 'Link',
'options': 'Company',
'permlevel': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'credit_days',
'fieldtype': 'Int',
'hidden': 0,
'idx': 16,
'label': 'Credit Days',
'oldfieldname': 'credit_days',
'oldfieldtype': 'Int',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'credit_limit',
'fieldtype': 'Currency',
'hidden': 0,
'idx': 17,
'label': 'Credit Limit',
'oldfieldname': 'credit_limit',
'oldfieldtype': 'Currency',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'master_type',
'fieldtype': 'Select',
'idx': 18,
'label': 'Master Type',
'oldfieldname': 'master_type',
'oldfieldtype': 'Select',
'options': '\nNA\nSupplier\nCustomer\nEmployee',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'master_name',
'fieldtype': 'Link',
'idx': 19,
'label': 'Master Name',
'oldfieldname': 'master_name',
'oldfieldtype': 'Link',
'permlevel': 0,
'trigger': 'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 20,
'label': 'TDS',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'pan_number',
'fieldtype': 'Data',
'idx': 21,
'label': 'PAN Number',
'oldfieldname': 'pan_number',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'default': 'No',
'doctype': 'DocField',
'fieldname': 'tds_applicable',
'fieldtype': 'Select',
'idx': 22,
'label': 'TDS Applicable',
'oldfieldname': 'tds_applicable',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'tds_details',
'fieldtype': 'Table',
'idx': 23,
'label': 'TDS Details',
'oldfieldname': 'tds_details',
'oldfieldtype': 'Table',
'options': 'TDS Detail',
'permlevel': 0
},
# DocField
{
'description': "Don't delete this field at any cost",
'doctype': 'DocField',
'fieldname': 'old_parent',
'fieldtype': 'Link',
'options': 'Account',
'hidden': 1,
'idx': 24,
'label': 'Old Parent',
'no_copy': 1,
'oldfieldname': 'old_parent',
'oldfieldtype': 'Data',
'permlevel': 0,
'report_hide': 1
},
# DocField
{
'colour': 'White:FFF',
'description': "Don't delete this field at any cost",
'doctype': 'DocField',
'fieldname': 'lft',
'fieldtype': 'Int',
'hidden': 1,
'idx': 25,
'in_filter': 1,
'label': 'Lft',
'no_copy': 1,
'oldfieldname': 'lft',
'oldfieldtype': 'Int',
'permlevel': 3,
'print_hide': 1,
'report_hide': 1,
'search_index': 1
},
# DocField
{
'colour': 'White:FFF',
'description': "Don't delete this field at any cost",
'doctype': 'DocField',
'fieldname': 'rgt',
'fieldtype': 'Int',
'hidden': 1,
'idx': 26,
'in_filter': 1,
'label': 'Rgt',
'no_copy': 1,
'oldfieldname': 'rgt',
'oldfieldtype': 'Int',
'permlevel': 3,
'print_hide': 1,
'report_hide': 1,
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'trash_reason',
'fieldtype': 'Small Text',
'idx': 27,
'label': 'Trash Reason',
'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text',
'permlevel': 1
}
]