From d7ddea1e2a156b1692e3d07af8dbc1bedfebc8c3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 13 Feb 2012 18:59:43 +0530 Subject: [PATCH] domain list patch --- .../jan_mar_2012/website/domain_list.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/website/domain_list.py diff --git a/erpnext/patches/jan_mar_2012/website/domain_list.py b/erpnext/patches/jan_mar_2012/website/domain_list.py new file mode 100644 index 00000000000..fabbdceec46 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/website/domain_list.py @@ -0,0 +1,22 @@ +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + reload_doc('website', 'doctype', 'website_settings') + + res = webnotes.conn.sql("""\ + SELECT name FROM `tabDocPerm` + WHERE parent='Website Settings' AND role='All' AND permlevel=1""") + if not res: + idx = webnotes.conn.sql("""\ + SELECT MAX(idx) FROM `tabDocPerm` + WHERE parent='Website Settings' + """)[0][0] + from webnotes.model.doc import Document + d = Document('DocType', 'Website Settings') + perm = d.addchild('permissions', 'DocPerm') + perm.read = 1 + perm.role = 'All' + perm.permlevel = 1 + perm.idx = idx + 1 + perm.save() +