You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

add_delete_permission.py 353 B

123456789101112
  1. import webnotes
  2. def execute():
  3. webnotes.reload_doc("core", "doctype", "docperm")
  4. # delete same as cancel (map old permissions)
  5. webnotes.conn.sql("""update tabDocPerm set `delete`=ifnull(`cancel`,0)""")
  6. # can't cancel if can't submit
  7. webnotes.conn.sql("""update tabDocPerm set `cancel`=0 where ifnull(`submit`,0)=0""")
  8. webnotes.clear_cache()