cleaned up sample website and separated fixtures by country

This commit is contained in:
Rushabh Mehta
2014-04-18 16:00:41 +05:30
parent 169c1fd93b
commit 370a024e46
16 changed files with 450 additions and 501 deletions

View File

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe, os
from frappe import _
from frappe.utils import cint
@@ -12,8 +12,6 @@ import frappe.defaults
from frappe.model.document import Document
class Company(Document):
def onload(self):
self.set("__transactions_exist", self.check_if_transactions_exist())
@@ -43,7 +41,7 @@ class Company(Document):
where company=%s and docstatus<2 limit 1""", self.name):
self.create_default_accounts()
self.create_default_warehouses()
self.create_default_web_page()
self.install_country_fixtures()
if not frappe.db.get_value("Cost Center", {"group_or_ledger": "Ledger",
"company": self.name}):
@@ -54,8 +52,12 @@ class Company(Document):
if self.default_currency:
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
def install_country_fixtures(self):
if os.path.exists(os.path.join(os.path.dirname(__file__), "fixtures", self.country.lower())):
frappe.get_attr("erpnext.setup.doctype.company.fixtures.{0}.install".format(self.country.lower()))(self)
def create_default_warehouses(self):
for whname in ("Stores", "Work In Progress", "Finished Goods"):
for whname in (_("Stores"), _("Work In Progress"), _("Finished Goods")):
if not frappe.db.exists("Warehouse", whname + " - " + self.abbr):
stock_group = frappe.db.get_value("Account", {"account_type": "Stock",
"group_or_ledger": "Group"})
@@ -67,47 +69,13 @@ class Company(Document):
"create_account_under": stock_group
}).insert()
def create_default_web_page(self):
if not frappe.db.get_value("Website Settings", None, "home_page") and \
not frappe.db.sql("select name from tabCompany where name!=%s", self.name):
import os
with open(os.path.join(os.path.dirname(__file__), "sample_home_page.html"), "r") as webfile:
webpage = frappe.get_doc({
"doctype": "Web Page",
"title": self.name + " Home",
"published": 1,
"description": "Standard Home Page for " + self.name,
"main_section": webfile.read() % self.as_dict()
}).insert()
# update in home page in settings
website_settings = frappe.get_doc("Website Settings", "Website Settings")
website_settings.home_page = webpage.name
website_settings.brand_html = self.name
website_settings.copyright = self.name
website_settings.append("top_bar_items", {
"doctype": "Top Bar Item",
"label":"Contact",
"url": "contact"
})
website_settings.append("top_bar_items", {
"doctype": "Top Bar Item",
"label":"Blog",
"url": "blog"
})
website_settings.save()
style_settings = frappe.get_doc("Style Settings", "Style Settings")
style_settings.top_bar_background = "F2F2F2"
style_settings.font_size = "15px"
style_settings.save()
def create_default_accounts(self):
if self.chart_of_accounts:
self.import_chart_of_account()
else:
self.create_standard_accounts()
frappe.db.set(self, "receivables_group", "Accounts Receivable - " + self.abbr)
frappe.db.set(self, "payables_group", "Accounts Payable - " + self.abbr)
frappe.db.set(self, "receivables_group", _("Accounts Receivable") + " - " + self.abbr)
frappe.db.set(self, "payables_group", _("Accounts Payable") + " - " + self.abbr)
def import_chart_of_account(self):
chart = frappe.get_doc("Chart of Accounts", self.chart_of_accounts)
@@ -134,15 +102,15 @@ class Company(Document):
frappe.db.set(self, field, account)
_set_default_accounts({
"default_cash_account": "Cash",
"default_bank_account": "Bank"
"default_cash_account": _("Cash"),
"default_bank_account": _("Bank")
})
if cint(frappe.db.get_value("Accounts Settings", None, "auto_accounting_for_stock")):
_set_default_accounts({
"stock_received_but_not_billed": "Stock Received But Not Billed",
"stock_adjustment_account": "Stock Adjustment",
"expenses_included_in_valuation": "Expenses Included In Valuation"
"stock_received_but_not_billed": _("Stock Received But Not Billed"),
"stock_adjustment_account": _("Stock Adjustment"),
"expenses_included_in_valuation": _("Expenses Included In Valuation")
})
def create_default_cost_center(self):
@@ -154,7 +122,7 @@ class Company(Document):
'parent_cost_center':''
},
{
'cost_center_name':'Main',
'cost_center_name':_('Main'),
'company':self.name,
'group_or_ledger':'Ledger',
'parent_cost_center':self.name + ' - ' + self.abbr
@@ -218,126 +186,78 @@ class Company(Document):
}
acc_list_common = [
['Application of Funds (Assets)','','Group','','Balance Sheet',self.name,''],
['Current Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''],
['Accounts Receivable','Current Assets','Group','','Balance Sheet',self.name,''],
['Bank Accounts','Current Assets','Group','Bank','Balance Sheet',self.name,''],
['Cash In Hand','Current Assets','Group','Cash','Balance Sheet',self.name,''],
['Cash','Cash In Hand','Ledger','Cash','Balance Sheet',self.name,''],
['Loans and Advances (Assets)','Current Assets','Group','','Balance Sheet',self.name,''],
['Securities and Deposits','Current Assets','Group','','Balance Sheet',self.name,''],
['Earnest Money','Securities and Deposits','Ledger','','Balance Sheet',self.name,''],
['Stock Assets','Current Assets','Group','Stock','Balance Sheet',self.name,''],
['Tax Assets','Current Assets','Group','','Balance Sheet',self.name,''],
['Fixed Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''],
['Capital Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''],
['Computers','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''],
['Furniture and Fixture','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''],
['Office Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''],
['Plant and Machinery','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''],
['Investments','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''],
['Temporary Accounts (Assets)','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''],
['Temporary Account (Assets)','Temporary Accounts (Assets)','Ledger','','Balance Sheet',self.name,''],
['Expenses','','Group','Expense Account','Profit and Loss',self.name,''],
['Direct Expenses','Expenses','Group','Expense Account','Profit and Loss',self.name,''],
['Stock Expenses','Direct Expenses','Group','Expense Account','Profit and Loss',self.name,''],
['Cost of Goods Sold','Stock Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Stock Adjustment','Stock Expenses','Ledger','Stock Adjustment','Profit and Loss',self.name,''],
['Expenses Included In Valuation', "Stock Expenses", 'Ledger', 'Expenses Included In Valuation', 'Profit and Loss', self.name, ''],
['Indirect Expenses','Expenses','Group','Expense Account','Profit and Loss',self.name,''],
['Advertising and Publicity','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''],
['Bad Debts Written Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Bank Charges','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Books and Periodicals','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Charity and Donations','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Commission on Sales','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Conveyance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Customer Entertainment Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Depreciation Account','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Freight and Forwarding Charges','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''],
['Legal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Miscellaneous Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''],
['Office Maintenance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Office Rent','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Postal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Print and Stationary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Rounded Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Salary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Sales Promotion Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''],
['Service Charges Paid','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Staff Welfare Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Telephone Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Travelling Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Water and Electricity Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''],
['Income','','Group','','Profit and Loss',self.name,''],
['Direct Income','Income','Group','Income Account','Profit and Loss',self.name,''],
['Sales','Direct Income','Ledger','Income Account','Profit and Loss',self.name,''],
['Service','Direct Income','Ledger','Income Account','Profit and Loss',self.name,''],
['Indirect Income','Income','Group','Income Account','Profit and Loss',self.name,''],
['Source of Funds (Liabilities)','','Group','','Balance Sheet',self.name,''],
['Capital Account','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''],
['Reserves and Surplus','Capital Account','Ledger','','Balance Sheet',self.name,''],
['Shareholders Funds','Capital Account','Ledger','','Balance Sheet',self.name,''],
['Current Liabilities','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''],
['Accounts Payable','Current Liabilities','Group','','Balance Sheet',self.name,''],
['Stock Liabilities','Current Liabilities','Group','','Balance Sheet',self.name,''],
['Stock Received But Not Billed', 'Stock Liabilities', 'Ledger', 'Stock Received But Not Billed', 'Balance Sheet', self.name, ''],
['Duties and Taxes','Current Liabilities','Group','','Balance Sheet',self.name,''],
['Loans (Liabilities)','Current Liabilities','Group','','Balance Sheet',self.name,''],
['Secured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.name,''],
['Unsecured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.name,''],
['Bank Overdraft Account','Loans (Liabilities)','Group','','Balance Sheet',self.name,''],
['Temporary Accounts (Liabilities)','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''],
['Temporary Account (Liabilities)','Temporary Accounts (Liabilities)','Ledger','','Balance Sheet',self.name,'']
[_('Application of Funds (Assets)'),'','Group','','Balance Sheet',self.name,''],
[_('Current Assets'),_('Application of Funds (Assets)'),'Group','','Balance Sheet',self.name,''],
[_('Accounts Receivable'),_('Current Assets'),'Group','','Balance Sheet',self.name,''],
[_('Bank Accounts'),_('Current Assets'),'Group','Bank','Balance Sheet',self.name,''],
[_('Cash In Hand'),_('Current Assets'),'Group','Cash','Balance Sheet',self.name,''],
[_('Cash'),_('Cash In Hand'),'Ledger','Cash','Balance Sheet',self.name,''],
[_('Loans and Advances (Assets)'),_('Current Assets'),'Group','','Balance Sheet',self.name,''],
[_('Securities and Deposits'),_('Current Assets'),'Group','','Balance Sheet',self.name,''],
[_('Earnest Money'),_('Securities and Deposits'),'Ledger','','Balance Sheet',self.name,''],
[_('Stock Assets'),_('Current Assets'),'Group','Stock','Balance Sheet',self.name,''],
[_('Tax Assets'),_('Current Assets'),'Group','','Balance Sheet',self.name,''],
[_('Fixed Assets'),_('Application of Funds (Assets)'),'Group','','Balance Sheet',self.name,''],
[_('Capital Equipments'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet',self.name,''],
[_('Computers'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet',self.name,''],
[_('Furniture and Fixture'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet',self.name,''],
[_('Office Equipments'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet',self.name,''],
[_('Plant and Machinery'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet',self.name,''],
[_('Investments'),_('Application of Funds (Assets)'),'Group','','Balance Sheet',self.name,''],
[_('Temporary Accounts (Assets)'),_('Application of Funds (Assets)'),'Group','','Balance Sheet',self.name,''],
[_('Temporary Account (Assets)'),_('Temporary Accounts (Assets)'),'Ledger','','Balance Sheet',self.name,''],
[_('Expenses'),'','Group','Expense Account','Profit and Loss',self.name,''],
[_('Direct Expenses'),_('Expenses'),'Group','Expense Account','Profit and Loss',self.name,''],
[_('Stock Expenses'),_('Direct Expenses'),'Group','Expense Account','Profit and Loss',self.name,''],
[_('Cost of Goods Sold'),_('Stock Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Stock Adjustment'),_('Stock Expenses'),'Ledger','Stock Adjustment','Profit and Loss',self.name,''],
[_('Expenses Included In Valuation'), _("Stock Expenses"), 'Ledger', 'Expenses Included In Valuation', 'Profit and Loss', self.name, ''],
[_('Indirect Expenses'), _('Expenses'),'Group','Expense Account','Profit and Loss',self.name,''],
[_('Marketing Expenses'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss',self.name,''],
[_('Sales Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Administrative Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Charity and Donations'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Commission on Sales'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Travel Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Entertainment Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Depreciation'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Freight and Forwarding Charges'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss',self.name,''],
[_('Legal Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Miscellaneous Expenses'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss',self.name,''],
[_('Office Maintenance Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Office Rent'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Postal Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Print and Stationary'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Rounded Off'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Salary') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Telephone Expenses') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Utility Expenses') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss',self.name,''],
[_('Income'),'','Group','','Profit and Loss',self.name,''],
[_('Direct Income'),_('Income'),'Group','Income Account','Profit and Loss',self.name,''],
[_('Sales'),_('Direct Income'),'Ledger','Income Account','Profit and Loss',self.name,''],
[_('Service'),_('Direct Income'),'Ledger','Income Account','Profit and Loss',self.name,''],
[_('Indirect Income'),_('Income'),'Group','Income Account','Profit and Loss',self.name,''],
[_('Source of Funds (Liabilities)'),'','Group','','Balance Sheet',self.name,''],
[_('Capital Account'),_('Source of Funds (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Reserves and Surplus'),_('Capital Account'),'Ledger','','Balance Sheet',self.name,''],
[_('Shareholders Funds'),_('Capital Account'),'Ledger','','Balance Sheet',self.name,''],
[_('Current Liabilities'),_('Source of Funds (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Accounts Payable'),'Current Liabilities','Group','','Balance Sheet',self.name,''],
[_('Stock Liabilities'),'Current Liabilities','Group','','Balance Sheet',self.name,''],
[_('Stock Received But Not Billed'), _('Stock Liabilities'), 'Ledger', 'Stock Received But Not Billed', 'Balance Sheet', self.name, ''],
[_('Duties and Taxes'),_('Current Liabilities'),'Group','','Balance Sheet',self.name,''],
[_('Loans (Liabilities)'),'Current Liabilities','Group','','Balance Sheet',self.name,''],
[_('Secured Loans'),_('Loans (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Unsecured Loans'),_('Loans (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Bank Overdraft Account'),_('Loans (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Temporary Accounts (Liabilities)'),_('Source of Funds (Liabilities)'),'Group','','Balance Sheet',self.name,''],
[_('Temporary Account (Liabilities)'),_('Temporary Accounts (Liabilities)'),'Ledger','','Balance Sheet',self.name,'']
]
acc_list_india = [
['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'4.00'],
['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'8.00'],
['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'10.00'],
['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'14.00'],
['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'2.00'],
['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'1.00'],
['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''],
['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'],
['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'],
['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'],
['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'4.00'],
['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'8.00'],
['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'10.00'],
['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'14.00'],
['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'10.3'],
['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'],
['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'],
['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'],
['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''],
['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,'']
]
# load common account heads
for d in acc_list_common:
self.add_acc(d)
country = frappe.db.get_default("country")
# load taxes (only for India)
if country == 'India':
for d in acc_list_india:
self.add_acc(d)
@frappe.whitelist()
def replace_abbr(company, old, new):
frappe.db.set_value("Company", company, "abbr", new)

View File

@@ -0,0 +1,81 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def install(company):
docs = [
{'doctype': 'Deduction Type', 'name': 'Professional Tax', 'description': 'Professional Tax', 'deduction_name': 'Professional Tax'},
{'doctype': 'Deduction Type', 'name': 'Provident Fund', 'description': 'Provident fund', 'deduction_name': 'Provident Fund'},
{'doctype': 'Earning Type', 'name': 'House Rent Allowance', 'description': 'House Rent Allowance', 'earning_name': 'House Rent Allowance', 'taxable': 'No'},
]
for d in docs:
try:
frappe.get_doc(d).insert()
except NameError:
pass
# accounts
fld_dict = {
'account_name': 0,
'parent_account': 1,
'group_or_ledger': 2,
'account_type': 3,
'report_type': 4,
'tax_rate': 5
}
acc_list_india = [
['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet','4.00'],
['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet','8.00'],
['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet','10.00'],
['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet','14.00'],
['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet','2.00'],
['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet','1.00'],
['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet',''],
['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'],
['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'],
['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'],
['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet','4.00'],
['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet','8.00'],
['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet','10.00'],
['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet','14.00'],
['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','10.3'],
['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'],
['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'],
['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'],
['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',''],
['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet','']
]
for lst in acc_list_india:
account = frappe.get_doc({
"doctype": "Account",
"freeze_account": "No",
"master_type": "",
"company": company.name
})
for d in fld_dict.keys():
account.set(d, (d == 'parent_account' and lst[fld_dict[d]]) and lst[fld_dict[d]] +' - '+ company.abbr or lst[fld_dict[d]])
account.insert()

View File

@@ -1,23 +0,0 @@
<p>This is a sample home page for your company <b>%(name)s's</b> website. This was
created from the Website Module inside ERPNext. ERPNext provides you with simple
tools to build and update your website. You can add sections like your Product Catalog,
Blog, Contact Us, About Us and so on. Messages entered in the "Contact" page are
automatically added as Leads in the system.
<h5>What you can do with your website:</h5>
<ul>
<li>Automatically generate products / services catalog from your Items.
<li>Capture Leads from your website.
<li>Communicate with your customers by sharing your thoughts in your Blog.
<li>Introduce your company and team in the About Us page.
</ul>
<p>Infact,
<a href="https://erpnext.com" target="_blank">erpnext.com</a>
website is built on ERPNext itself.</p>
<p><a href="login" class="btn btn-primary">Login to your Account</a><p>
<p class="text-muted pull-right">For more help, <a href="http://erpnext.org" target="_blank">
click here</a></p>

View File

@@ -1,16 +1,26 @@
[
{
"abbr": "_TC",
"company_name": "_Test Company",
"default_currency": "INR",
"doctype": "Company",
"abbr": "_TC",
"company_name": "_Test Company",
"country": "India",
"default_currency": "INR",
"doctype": "Company",
"domain": "Manufacturing"
},
},
{
"abbr": "_TC1",
"company_name": "_Test Company 1",
"default_currency": "USD",
"doctype": "Company",
"abbr": "_TC1",
"company_name": "_Test Company 1",
"country": "United States",
"default_currency": "USD",
"doctype": "Company",
"domain": "Retail"
},
{
"abbr": "_TC2",
"company_name": "_Test Company 3",
"default_currency": "EUR",
"country": "Germany",
"doctype": "Company",
"domain": "Retail"
}
]
]

View File

@@ -14,23 +14,21 @@ class ItemGroup(NestedSet, WebsiteGenerator):
self.name = self.item_group_name
def validate(self):
super(ItemGroup, self).on_update()
if not self.parent_website_route:
self.parent_website_route = frappe.get_website_route("Item Group",
self.parent_item_group)
def on_update(self):
NestedSet.on_update(self)
WebsiteGenerator.on_update(self)
super(ItemGroup, self).on_update()
self.validate_name_with_item()
self.validate_one_root()
def after_rename(self, olddn, newdn, merge=False):
NestedSet.after_rename(self, olddn, newdn, merge)
WebsiteGenerator.after_rename(self, olddn, newdn, merge)
super(ItemGroup, self).on_update()
def on_trash(self):
NestedSet.on_trash(self)
WebsiteGenerator.on_trash(self)
super(ItemGroup, self).on_update()
def validate_name_with_item(self):
if frappe.db.exists("Item", self.name):