brotherton-erpnext/patches/april_2013/p04_update_role_in_pages.py
2013-11-20 13:00:28 +05:30

15 lines
432 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
import webnotes.model
def execute():
for p in ["activity", "todo", "questions", "question-view"]:
pbean = webnotes.bean("Page", p)
if len(pbean.doclist) == 1:
pbean.doclist.append({
"doctype": "Page Role",
"role": "All",
"parentfield": "roles"
})
pbean.save()