brotherton-erpnext/patches/september_2012/add_stock_ledger_entry_index.py

12 lines
329 B
Python
Raw Normal View History

2012-10-01 06:05:49 +00:00
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.conn.commit()
try:
2012-09-19 06:53:35 +00:00
webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")
webnotes.conn.commit()
except Exception, e:
if e.args[0]!=1061: raise e
webnotes.conn.begin()