brotherton-erpnext/patches/april_2012/repost_stock_for_posting_time.py

14 lines
548 B
Python
Raw Normal View History

from __future__ import unicode_literals
def execute():
import webnotes
res = webnotes.conn.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry`
where posting_time > '00:00:00' and posting_time < '00:01:00'""", as_dict=1)
2012-04-30 06:25:25 +00:00
webnotes.conn.sql("update `tabStock Ledger Entry` set posting_time = '00:00:00' where posting_time > '00:00:00' and posting_time < '00:01:00'")
from stock.stock_ledger import update_entries_after
for d in res:
update_entries_after({
2013-01-09 09:53:05 +00:00
"item_code": d.item_code,
"warehouse": d.warehouse,
})