[utility] repost stock

This commit is contained in:
Nabin Hait
2013-10-23 11:50:09 +05:30
parent 688c2ef588
commit 4ed7f68344
2 changed files with 6 additions and 10 deletions

View File

@@ -13,8 +13,11 @@ def repost():
"""
webnotes.conn.auto_commit_on_many_writes = 1
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
repost_stock(d[0], d[1])
for d in webnotes.conn.sql("""select distinct item_code, warehouse from
(select item_code, warehouse from tabBin
union
select item_code, warehouse from `tabStock Ledger Entry`)"""):
repost_stock(d[0], d[1])
webnotes.conn.auto_commit_on_many_writes = 0