mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
[patch] create chart of accounts if not created
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
import webnotes
|
|
||||||
def execute():
|
|
||||||
for company in webnotes.conn.sql("select name from `tabCompany`"):
|
|
||||||
if not webnotes.conn.sql("select * from `tabAccount` where company = %s", company[0]):
|
|
||||||
webnotes.conn.sql("""update `tabCompany` set receivables_group = '',
|
|
||||||
payables_group = '' where name = %s""", company[0])
|
|
||||||
webnotes.bean("Company", company[0]).save()
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.reload_doc("setup", "doctype", "company")
|
webnotes.reload_doc("setup", "doctype", "company")
|
||||||
|
create_chart_of_accounts_if_not_exists()
|
||||||
add_group_accounts()
|
add_group_accounts()
|
||||||
add_ledger_accounts()
|
add_ledger_accounts()
|
||||||
add_aii_cost_center()
|
add_aii_cost_center()
|
||||||
@@ -94,4 +94,10 @@ def add_aii_cost_center():
|
|||||||
})
|
})
|
||||||
cc.insert()
|
cc.insert()
|
||||||
|
|
||||||
|
def create_chart_of_accounts_if_not_exists():
|
||||||
|
for company in webnotes.conn.sql("select name from `tabCompany`"):
|
||||||
|
if not webnotes.conn.sql("select * from `tabAccount` where company = %s", company[0]):
|
||||||
|
webnotes.conn.sql("""update `tabCompany` set receivables_group = '',
|
||||||
|
payables_group = '' where name = %s""", company[0])
|
||||||
|
webnotes.bean("Company", company[0]).save()
|
||||||
|
|
||||||
@@ -230,7 +230,6 @@ patch_list = [
|
|||||||
"patches.march_2013.p11_update_attach_files",
|
"patches.march_2013.p11_update_attach_files",
|
||||||
"patches.march_2013.p12_set_item_tax_rate_in_json",
|
"patches.march_2013.p12_set_item_tax_rate_in_json",
|
||||||
"patches.march_2013.p07_update_valuation_rate",
|
"patches.march_2013.p07_update_valuation_rate",
|
||||||
"patches.april_2013.p05_create_chart_of_accounts",
|
|
||||||
"patches.march_2013.p08_create_aii_accounts",
|
"patches.march_2013.p08_create_aii_accounts",
|
||||||
"patches.march_2013.p03_update_buying_amount",
|
"patches.march_2013.p03_update_buying_amount",
|
||||||
"patches.april_2013.p01_update_serial_no_valuation_rate",
|
"patches.april_2013.p01_update_serial_no_valuation_rate",
|
||||||
|
|||||||
Reference in New Issue
Block a user