diff --git a/erpnext/patches/jan_mar_2012/cancel_purchase_returned.py b/erpnext/patches/jan_mar_2012/cancel_purchase_returned.py new file mode 100644 index 00000000000..8404f190c07 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/cancel_purchase_returned.py @@ -0,0 +1,8 @@ +def execute(): + """ + Set docstatus = 2 where status = 'Purchase Returned' for serial no + """ + import webnotes + webnotes.conn.sql("""\ + UPDATE `tabSerial No` SET docstatus=2 + WHERE status='Purchase Returned'""") diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index bb2e44169fc..c05912b0981 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -55,4 +55,9 @@ patch_list = [ 'patch_file': 'serial_no_add_opt', 'description': "Add option 'Purchase Returned' to Serial No status field" }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'cancel_purchase_returned', + 'description': "Set docstatus = 2 where status = 'Purchase Returned' for serial no" + }, ]