removed unwanted permission
This commit is contained in:
parent
3ac8e59cb8
commit
a8454e2764
14
patches/january_2013/remove_unwanted_permission.py
Normal file
14
patches/january_2013/remove_unwanted_permission.py
Normal file
@ -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
|
@ -155,4 +155,5 @@ patch_list = [
|
||||
"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",
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user