From 5d4aaaa8a719b39f0eec2f897b24086ee04991ec Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 17 Jul 2012 13:06:34 +0530 Subject: [PATCH] patch to remove match condition of owner on event doctype --- erpnext/patches/july_2012/remove_event_role_owner_match.py | 5 +++++ erpnext/patches/patch_list.py | 5 +++++ public/js/all-app.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/july_2012/remove_event_role_owner_match.py diff --git a/erpnext/patches/july_2012/remove_event_role_owner_match.py b/erpnext/patches/july_2012/remove_event_role_owner_match.py new file mode 100644 index 0000000000..deb99cf0e7 --- /dev/null +++ b/erpnext/patches/july_2012/remove_event_role_owner_match.py @@ -0,0 +1,5 @@ +def execute(): + import webnotes + webnotes.conn.sql("""\ + update `tabDocPerm` set match=NULL + where parent='Event' and role='All' and permlevel=0""") \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 5a6748c966..b538c3d7b1 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -487,4 +487,9 @@ patch_list = [ 'patch_file': 'cms2', 'description': 'cms2 release patches' }, + { + 'patch_module': 'patches.july_2012', + 'patch_file': 'remove_event_role_owner_match', + 'description': "Remove Owner match from Event DocType's Permissions" + }, ] \ No newline at end of file diff --git a/public/js/all-app.js b/public/js/all-app.js index c5733c0aea..f1d29793e9 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -1768,7 +1768,7 @@ if(this.frm_head)this.frm_head.refresh();if(wn.ui.toolbar.recent) wn.ui.toolbar.recent.add(this.doctype,this.docname,1);} _f.Frm.prototype.check_doc_perm=function(){var dt=this.parent_doctype?this.parent_doctype:this.doctype;var dn=this.parent_docname?this.parent_docname:this.docname;this.perm=get_perm(dt,dn);this.orig_perm=get_perm(dt,dn,1);if(!this.perm[0][READ]){if(user=='Guest'){if(_f.temp_access[dt]&&_f.temp_access[dt][dn]){this.perm=[[1,0,0]] return 1;}} -window.back();return 0;} +window.history.back();return 0;} return 1} _f.Frm.prototype.refresh=function(docname){if(docname){if(this.docname!=docname&&(!this.meta.in_dialog||this.in_form)&&!this.meta.istable)scroll(0,0);this.docname=docname;} if(!this.meta.istable){cur_frm=this;this.parent.cur_frm=this;}