[patch] create chart of accounts if not created

This commit is contained in:
Nabin Hait
2013-04-09 14:56:30 +05:30
parent 3594873a63
commit 5639035268
3 changed files with 7 additions and 9 deletions

View File

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