From a8caa5edef727a7085303064492f42789e0697a1 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 Feb 2013 16:45:37 +0530 Subject: [PATCH 1/2] patch to delete warehouses with docstatus = 2 --- patches/february_2013/p09_remove_cancelled_warehouses.py | 9 +++++++++ patches/patch_list.py | 1 + 2 files changed, 10 insertions(+) create mode 100644 patches/february_2013/p09_remove_cancelled_warehouses.py diff --git a/patches/february_2013/p09_remove_cancelled_warehouses.py b/patches/february_2013/p09_remove_cancelled_warehouses.py new file mode 100644 index 0000000000..05e569ab72 --- /dev/null +++ b/patches/february_2013/p09_remove_cancelled_warehouses.py @@ -0,0 +1,9 @@ +import webnotes + +def execute(): + for w in webnotes.conn.sql("""select name from `tabWarehouse` where docstatus=2"""): + try: + webnotes.delete_doc("Warehouse", w[0]) + except webnotes.ValidationError: + pass + \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 11608098c1..9e5d6f69af 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -200,4 +200,5 @@ patch_list = [ 'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Modern") # 2013-02-26', 'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26', "execute:(not webnotes.conn.exists('Role', 'Projects Manager')) and webnotes.doc({'doctype':'Role', 'role_name':'Projects Manager'}).insert()", + "patches.february_2013.p09_remove_cancelled_warehouses", ] \ No newline at end of file From 4a36e479c1e0304b17f62785ffd787867571d4d2 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 Feb 2013 17:41:03 +0530 Subject: [PATCH 2/2] fix in subcontracted validation --- stock/doctype/purchase_receipt/purchase_receipt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py index 6772103759..88003ca682 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/stock/doctype/purchase_receipt/purchase_receipt.py @@ -293,7 +293,7 @@ class DocType(BuyingController): webnotes.msgprint(_("""Please enter whether Purchase Recipt is made for subcontracting or purchasing, in 'Is Subcontracted' field"""), raise_exception=1) - if self.doc.is_subcontracted and not self.doc.supplier_warehouse: + if self.doc.is_subcontracted=="Yes" and not self.doc.supplier_warehouse: webnotes.msgprint(_("Please Enter Supplier Warehouse for subcontracted Items"), raise_exception=1)