mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
moved directory structure
This commit is contained in:
1
accounts/doctype/account/__init__.py
Normal file
1
accounts/doctype/account/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
||||
120
accounts/doctype/account/account.js
Normal file
120
accounts/doctype/account/account.js
Normal file
@@ -0,0 +1,120 @@
|
||||
// ERPNext - web based ERP (http://erpnext.com)
|
||||
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
// Onload
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.set_breadcrumbs = function(barea) {
|
||||
cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname);
|
||||
cur_frm.frm_head.appframe.add_breadcrumb(' in <a href="#!Accounts Browser/Account">\
|
||||
Chart of Accounts</a>');
|
||||
cur_frm.frm_head.appframe.add_breadcrumb(' in <a href="#!accounts-home">Accounts</a>');
|
||||
}
|
||||
|
||||
// Refresh
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.toggle_display('account_name', doc.__islocal);
|
||||
|
||||
// hide fields if group
|
||||
cur_frm.toggle_display(['account_type', 'master_type', 'master_name', 'freeze_account',
|
||||
'credit_days', 'credit_limit', 'tax_rate'], doc.group_or_ledger=='Ledger')
|
||||
|
||||
// read-only for root accounts
|
||||
root_acc = ['Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)'];
|
||||
if(in_list(root_acc, doc.account_name)) {
|
||||
cur_frm.perm = [[1,0,0], [1,0,0]];
|
||||
cur_frm.set_intro("This is a root account and cannot be edited.");
|
||||
} else {
|
||||
// credit days and type if customer or supplier
|
||||
cur_frm.set_intro(null);
|
||||
cur_frm.toggle_display(['credit_days', 'credit_limit'],
|
||||
in_list(['Customer', 'Supplier'], doc.master_type))
|
||||
|
||||
// hide tax_rate
|
||||
cur_frm.cscript.account_type(doc, cdt, cdn);
|
||||
|
||||
// show / hide convert buttons
|
||||
cur_frm.cscript.hide_unhide_group_ledger(doc);
|
||||
}
|
||||
}
|
||||
|
||||
// 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.group_or_ledger=='Ledger') {
|
||||
cur_frm.toggle_display(['tax_rate'],
|
||||
doc.account_type == 'Tax');
|
||||
cur_frm.toggle_display(['master_type', 'master_name'],
|
||||
cstr(doc.account_type)=='');
|
||||
}
|
||||
}
|
||||
|
||||
// Hide/unhide group or ledger
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
|
||||
if (cstr(doc.group_or_ledger) == 'Group') {
|
||||
cur_frm.add_custom_button('Convert to Ledger',
|
||||
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
|
||||
} else if (cstr(doc.group_or_ledger) == 'Ledger') {
|
||||
cur_frm.add_custom_button('Convert to Group',
|
||||
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
|
||||
}
|
||||
}
|
||||
// Convert group to ledger
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
|
||||
$c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
|
||||
if(r.message == 1) {
|
||||
cur_frm.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Convert ledger to group
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
|
||||
$c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
|
||||
if(r.message == 1) {
|
||||
cur_frm.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 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';
|
||||
}
|
||||
}
|
||||
|
||||
// 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';
|
||||
}
|
||||
291
accounts/doctype/account/account.py
Normal file
291
accounts/doctype/account/account.py
Normal file
@@ -0,0 +1,291 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Please edit this list and import only required elements
|
||||
from __future__ import unicode_literals
|
||||
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, getchildren, make_autoname
|
||||
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]
|
||||
elif self.doc.account_name not in ['Income','Source of Funds (Liabilities)',\
|
||||
'Expenses','Application of Funds (Assets)']:
|
||||
msgprint("Parent Account is mandatory", raise_exception=1)
|
||||
|
||||
|
||||
# Account name must be unique
|
||||
def validate_duplicate_account(self):
|
||||
if (self.doc.fields.get('__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)
|
||||
elif self.doc.master_type or self.doc.account_type:
|
||||
msgprint("Cannot covert to Group because Master Type or Account Type is selected.",
|
||||
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)
|
||||
|
||||
# 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')
|
||||
|
||||
def validate_mandatory(self):
|
||||
if not self.doc.debit_or_credit:
|
||||
msgprint("Debit or Credit field is mandatory", raise_exception=1)
|
||||
if not self.doc.is_pl_account:
|
||||
msgprint("Is PL Account field is mandatory", raise_exception=1)
|
||||
|
||||
|
||||
# VALIDATE
|
||||
def validate(self):
|
||||
self.validate_master_name()
|
||||
self.validate_rate_for_tax()
|
||||
self.validate_parent()
|
||||
self.validate_duplicate_account()
|
||||
self.validate_root_details()
|
||||
self.validate_mandatory()
|
||||
|
||||
# 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('Global Defaults', 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 (Sales Invoice / Purchase Invoice / Journal Voucher) 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
|
||||
from webnotes.utils.nestedset import update_remove_node
|
||||
update_remove_node('Account', self.doc.name)
|
||||
|
||||
# delete all cancelled gl entry of this account
|
||||
sql("delete from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'Yes'", self.doc.name)
|
||||
|
||||
#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()
|
||||
# intiate balances
|
||||
self.set_year_balance()
|
||||
|
||||
# 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))
|
||||
396
accounts/doctype/account/account.txt
Normal file
396
accounts/doctype/account/account.txt
Normal file
@@ -0,0 +1,396 @@
|
||||
# DocType, Account
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-07-03 13:30:50',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-07-11 13:58:44',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1325570645',
|
||||
'allow_copy': 1,
|
||||
'allow_trash': 1,
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'An **Account** is heading under which financial and business transactions are carried on. For example, \u201cTravel Expense\u201d is an account, \u201cCustomer Zoe\u201d, \u201cSupplier Mae\u201d are accounts. \n\n**Note:** ERPNext creates accounts for Customers and Suppliers automatically.\n\n### Groups and Ledgers\n\nThere are two main kinds of Accounts in ERPNext - Group and Ledger. Groups can have sub-groups and ledgers within them, whereas ledgers are the leaf nodes of your chart and cannot be further classified.\n\nAccounting Transactions can only be made against Ledger Accounts (not Groups)\n',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'in_create': 1,
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'search_fields': u'debit_or_credit, group_or_ledger',
|
||||
'section_style': u'Tray',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Account',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Account',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1,
|
||||
'submit': 0
|
||||
},
|
||||
|
||||
# DocType, Account
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Account'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Auditor',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Auditor',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Auditor',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Purchase User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Accounts User',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Accounts User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Accounts User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'properties',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Account Details',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break0',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'account_name',
|
||||
'fieldtype': u'Data',
|
||||
'in_filter': 1,
|
||||
'label': u'Account Name',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'account_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'level',
|
||||
'fieldtype': u'Int',
|
||||
'hidden': 1,
|
||||
'label': u'Level',
|
||||
'oldfieldname': u'level',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': u'Ledger',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'group_or_ledger',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Group or Ledger',
|
||||
'oldfieldname': u'group_or_ledger',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nLedger\nGroup',
|
||||
'permlevel': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'debit_or_credit',
|
||||
'fieldtype': u'Data',
|
||||
'in_filter': 1,
|
||||
'label': u'Debit or Credit',
|
||||
'oldfieldname': u'debit_or_credit',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'is_pl_account',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Is PL Account',
|
||||
'oldfieldname': u'is_pl_account',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Yes\nNo',
|
||||
'permlevel': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Company',
|
||||
'oldfieldname': u'company',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Company',
|
||||
'permlevel': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break1',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'parent_account',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Parent Account',
|
||||
'oldfieldname': u'parent_account',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Account',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Setting Account Type helps in selecting this Account in transactions.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'account_type',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Account Type',
|
||||
'oldfieldname': u'account_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable',
|
||||
'permlevel': 0,
|
||||
'search_index': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Rate at which this tax is applied',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'tax_rate',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 0,
|
||||
'label': u'Rate',
|
||||
'oldfieldname': u'tax_rate',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'If the account is frozen, entries are allowed for the "Account Manager" only.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'freeze_account',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Frozen',
|
||||
'oldfieldname': u'freeze_account',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'No\nYes',
|
||||
'permlevel': 2
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_days',
|
||||
'fieldtype': u'Int',
|
||||
'hidden': 1,
|
||||
'label': u'Credit Days',
|
||||
'oldfieldname': u'credit_days',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_limit',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 1,
|
||||
'label': u'Credit Limit',
|
||||
'oldfieldname': u'credit_limit',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'If this Account represents a Customer, Supplier or Employee, set it here.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'master_type',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Master Type',
|
||||
'oldfieldname': u'master_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nSupplier\nCustomer\nEmployee',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'master_name',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Master Name',
|
||||
'oldfieldname': u'master_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user