Reload permissions for master and setting documents

This commit is contained in:
Anand Doshi 2014-06-06 15:09:26 +05:30
parent b5cefa92fa
commit 171c00cfd6
3 changed files with 40 additions and 2 deletions

View File

@ -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": [
@ -200,6 +200,20 @@
"role": "Employee",
"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,

View File

@ -47,3 +47,6 @@ erpnext.patches.v4_0.update_account_root_type
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

View File

@ -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