mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
[patch] create chart of accounts if not created
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import webnotes
|
||||
def execute():
|
||||
webnotes.reload_doc("setup", "doctype", "company")
|
||||
|
||||
create_chart_of_accounts_if_not_exists()
|
||||
add_group_accounts()
|
||||
add_ledger_accounts()
|
||||
add_aii_cost_center()
|
||||
@@ -94,4 +94,10 @@ def add_aii_cost_center():
|
||||
})
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user