Patch to set docstatus=2 for purchase returned serial no
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 0000000..8404f19
--- /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 bb2e441..c05912b 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -55,4 +55,9 @@
 		'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"
+	},
 ]