2013-01-10 11:41:48 +00:00
|
|
|
import webnotes
|
|
|
|
def execute():
|
|
|
|
webnotes.reload_doc("core", "doctype", "docperm")
|
|
|
|
webnotes.conn.sql("""update tabDocPerm set `report`=`write`""")
|
2013-01-11 09:35:03 +00:00
|
|
|
|
|
|
|
# no report for singles
|
2013-01-10 11:41:48 +00:00
|
|
|
webnotes.conn.sql("""update tabDocPerm, tabDocType set tabDocPerm.`report`=0
|
|
|
|
where tabDocPerm.`parent` = tabDocType.name
|
|
|
|
and ifnull(tabDocType.issingle,0) = 1""")
|
2013-01-11 09:35:03 +00:00
|
|
|
|
|
|
|
# no submit for not submittables
|
2013-01-10 11:41:48 +00:00
|
|
|
webnotes.conn.sql("""update tabDocPerm, tabDocType set tabDocPerm.`submit`=0
|
|
|
|
where tabDocPerm.`parent` = tabDocType.name
|
|
|
|
and ifnull(tabDocType.is_submittable,0) = 0""")
|