brotherton-erpnext/patches/february_2013/p09_remove_cancelled_warehouses.py
2013-02-28 16:45:37 +05:30

9 lines
212 B
Python

import webnotes
def execute():
for w in webnotes.conn.sql("""select name from `tabWarehouse` where docstatus=2"""):
try:
webnotes.delete_doc("Warehouse", w[0])
except webnotes.ValidationError:
pass