Nabin Hait | 44a40b8 | 2014-01-27 15:02:30 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | import webnotes |
| 5 | |
| 6 | def execute(): |
Nabin Hait | 191935b | 2014-01-27 17:37:06 +0530 | [diff] [blame] | 7 | webnotes.conn.auto_commit_on_many_writes = 1 |
Nabin Hait | 44a40b8 | 2014-01-27 15:02:30 +0530 | [diff] [blame] | 8 | 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 Hait | 191935b | 2014-01-27 17:37:06 +0530 | [diff] [blame] | 11 | repost_stock(d.production_item, d.fg_warehouse) |
| 12 | |
| 13 | webnotes.conn.auto_commit_on_many_writes = 0 |