[patch] create chart of accounts if not created

This commit is contained in:
Nabin Hait 2013-04-09 14:49:00 +05:30
parent ead385e8a4
commit 3594873a63

View 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()