patch to update cancelled BOMs

This commit is contained in:
Anand Doshi 2012-11-27 18:55:17 +05:30
parent ab6848d37b
commit a22bd841eb
2 changed files with 18 additions and 0 deletions

View 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],))

View File

@ -683,4 +683,8 @@ patch_list = [
'patch_module': 'patches.november_2012',
'patch_file': 'support_ticket_response_to_communication',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'cancelled_bom_patch',
},
]