Patch to migrate allow_print and allow_email to print and email rights of DocPerm

This commit is contained in:
Anand Doshi
2013-12-20 19:33:11 +05:30
parent 68852f25b5
commit 9b67f4344b
2 changed files with 13 additions and 3 deletions

View File

@@ -33,10 +33,9 @@ def update_user_match():
doctype_matches.setdefault(doctype, []).append(match)
for doctype, user_matches in doctype_matches.items():
# get permissions of this doctype
perms = webnotes.conn.sql("""select role, `match` from `tabDocPerm`
where parent=%s and permlevel=0 and read=1""", doctype, as_dict=True)
where parent=%s and permlevel=0 and `read`=1""", doctype, as_dict=True)
# for each user with roles of this doctype, check if match condition applies
for profile in webnotes.conn.sql_list("""select name from `tabProfile`