removed unwanted permission
diff --git a/patches/january_2013/remove_unwanted_permission.py b/patches/january_2013/remove_unwanted_permission.py
new file mode 100644
index 0000000..2c014ec
--- /dev/null
+++ b/patches/january_2013/remove_unwanted_permission.py
@@ -0,0 +1,14 @@
+def execute():
+ import webnotes
+ for dt in webnotes.conn.sql("""select name, issingle from tabDocType"""):
+ if dt[1]:
+ webnotes.conn.sql("""update tabDocPerm set report = 0 where parent = %s""", dt[0])
+
+
+ doctype = webnotes.model_wrapper("DocType", dt[0])
+ for pl in [1, 2, 3]:
+ if not doctype.doclist.get({"doctype": "DocField", "permlevel": pl}):
+ if doctype.doclist.get({"doctype":"DocPerm", "permlevel":pl}):
+ webnotes.conn.sql("""delete from `tabDocPerm`
+ where parent = %s and permlevel = %s""", (dt[0], pl))
+ print doctype.doc.name
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index cdaa2ad..7e87fe4 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -155,4 +155,5 @@
"patches.january_2013.purchase_price_list",
"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
"patches.january_2013.update_fraction_for_usd",
+ "patches.january_2013.remove_unwanted_permission",
]
\ No newline at end of file