From 3325d0db740925588cc9a7b4aa68f21cd87d0c8a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 1 Feb 2012 11:36:31 +0530 Subject: [PATCH] Patch to set docstatus=2 for purchase returned serial no --- erpnext/patches/jan_mar_2012/cancel_purchase_returned.py | 8 ++++++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/cancel_purchase_returned.py 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 0000000000..8404f190c0 --- /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 bb2e44169f..c05912b098 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" + }, ]