mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 00:25:01 +00:00
[patch] create chart of accounts if not created
This commit is contained in:
7
patches/april_2013/p05_create_chart_of_accounts.py
Normal file
7
patches/april_2013/p05_create_chart_of_accounts.py
Normal file
@@ -0,0 +1,7 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user