Reload permissions for master and setting documents
diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json
index 7a7e129..beda3de 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.json
+++ b/erpnext/hr/doctype/leave_application/leave_application.json
@@ -182,9 +182,9 @@
"idx": 1,
"is_submittable": 1,
"max_attachments": 3,
- "modified": "2014-05-27 03:49:12.957706",
+ "modified": "2014-06-06 05:06:44.594229",
"modified_by": "Administrator",
- "module": "HR",
+ "module": "Hr",
"name": "Leave Application",
"owner": "Administrator",
"permissions": [
@@ -201,6 +201,20 @@
"write": 1
},
{
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "set_user_permissions": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
"amend": 0,
"cancel": 0,
"create": 0,
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f68af6a..1ff3136 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -47,3 +47,6 @@
execute:frappe.delete_doc("Report", "Purchase In Transit")
erpnext.patches.v4_0.new_address_template
execute:frappe.delete_doc("DocType", "SMS Control")
+
+# WATCHOUT: This patch reload's documents
+erpnext.patches.v4_0.reset_permissions_for_masters
diff --git a/erpnext/patches/v4_0/reset_permissions_for_masters.py b/erpnext/patches/v4_0/reset_permissions_for_masters.py
new file mode 100644
index 0000000..fdafb87
--- /dev/null
+++ b/erpnext/patches/v4_0/reset_permissions_for_masters.py
@@ -0,0 +1,21 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ for doctype in ("About Us Settings", "Accounts Settings", "Activity Type",
+ "Blog Category", "Blog Settings", "Blogger", "Branch", "Brand", "Buying Settings",
+ "Comment", "Communication", "Company", "Contact Us Settings",
+ "Country", "Currency", "Currency Exchange", "Deduction Type", "Department",
+ "Designation", "Earning Type", "Event", "Feed", "File Data", "Fiscal Year",
+ "HR Settings", "Industry Type", "Jobs Email Settings", "Leave Type", "Letter Head",
+ "Mode of Payment", "Module Def", "Naming Series", "POS Setting", "Print Heading",
+ "Report", "Role", "Sales Email Settings", "Selling Settings", "Shopping Cart Settings",
+ "Stock Settings", "Supplier Type", "UOM"):
+ try:
+ frappe.reset_perms(doctype)
+ except:
+ print "Error resetting perms for", doctype
+ raise