diff --git a/patches/april_2013/p05_create_chart_of_accounts.py b/patches/april_2013/p05_create_chart_of_accounts.py new file mode 100644 index 00000000000..3a38a2c8636 --- /dev/null +++ b/patches/april_2013/p05_create_chart_of_accounts.py @@ -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() \ No newline at end of file