mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
patch to update cancelled BOMs
This commit is contained in:
14
patches/november_2012/cancelled_bom_patch.py
Normal file
14
patches/november_2012/cancelled_bom_patch.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
cancelled_boms = webnotes.conn.sql("""select name from `tabBOM`
|
||||
where docstatus = 2""")
|
||||
|
||||
for bom in cancelled_boms:
|
||||
webnotes.conn.sql("""update `tabBOM` set is_default=0, is_active='No'
|
||||
where name=%s""", (bom[0],))
|
||||
|
||||
webnotes.conn.sql("""update `tabItem` set default_bom=null
|
||||
where default_bom=%s""", (bom[0],))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user