blob: 979d94985b6beb0da6b4ad0446bf332a29f4627e [file] [log] [blame]
Nabin Hait44a40b82014-01-27 15:02:30 +05301# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4import webnotes
5
6def execute():
Nabin Hait191935b2014-01-27 17:37:06 +05307 webnotes.conn.auto_commit_on_many_writes = 1
Nabin Hait44a40b82014-01-27 15:02:30 +05308 from utilities.repost_stock import repost_stock
9 for d in webnotes.conn.sql("""select distinct production_item, fg_warehouse
10 from `tabProduction Order` where docstatus>0""", as_dict=1):
Nabin Hait191935b2014-01-27 17:37:06 +053011 repost_stock(d.production_item, d.fg_warehouse)
12
13 webnotes.conn.auto_commit_on_many_writes = 0