[patch] create chart of accounts if not created
This commit is contained in:
parent
ead385e8a4
commit
3594873a63
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()
|
Loading…
Reference in New Issue
Block a user